Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's  sign at the beginning of my source file?

I have a PHP source file where  characters automatically got added in! I don't know from where they have come. I'm not getting any parse errors but it results in weird behavior in the execution of the file. E.g. header location functionality is not working sometimes! I'm curious how these kind of symbols are getting auto generated? I'm using UTF-8 encoding & the sign  is not showing in Notepad++ or Windows Notepad but with Netbeans IDE.

Eg. Code:

<?php
echo "no errors!";
header("Location: http://stackoverflow.com");
exit;
?>

What is this? How can I prevent it?

like image 791
Jenson M John Avatar asked Sep 17 '13 09:09

Jenson M John


People also ask

What is this ï?

Ï, lowercase ï, is a symbol used in various languages written with the Latin alphabet; it can be read as the letter I with diaeresis or I-umlaut.

How to remove byte order mark?

How to remove BOM. If you want to remove the byte order mark from a source code, you need a text editor that offers the option of saving the mark. You read the file with the BOM into the software, then save it again without the BOM and thereby convert the coding. The mark should then no longer appear.

What is ÿþ?

The ÿþ character is known as the byte order marking (BOM) character and is commonly found as the first line of a CSV file. ÿþ can not be seen when the CSV is opened with Notepad or Excel for that an Editor is required that can display the BOM (Byte Order Mark).


1 Answers

You propably save the files as UTF-8 with BOM. You should save them as UTF-8 without BOM.

like image 143
user2394156 Avatar answered Dec 09 '22 05:12

user2394156