Thursday, 18 April 2013

Unicode characters being displayed as Boxes and Questions marks

Unicode characters being displayed as Boxes and Questions marks

Recently I faced a problem while development of a multilingual website, which was in English and German language, it was showing some german characters as Box ad Questions marks just like :

(Internet Explorer)

(Google Chrome)


Reason was that, I was using notepad++ and notepad as the developmnet enviromnet as the development platform was PHP, so when I was saving the files it was being saved as ANSI coding and other than UTF-8.


What I did, I re-opened the files having unicode content/characters, in Visual Studio or in Notepad.

Visual Studio
In visual studio, right click on the source page on any white area and take properties, it will show you the coding it is being following, change that to UTF-8 and if it is already selected then just save the file as it is again, and then again check , your issue must have resolved, and it must now show the characters properly in browsers.

In notepad, click File > Save As, and then at the time of saving the file, there must be a coding technique option dropdown, by default there could be ANSI selected. Change that to UTF-8,  and don't forget to change file type to "All files" , other wise it might concate ".txt" (dot text) extension with the file extension, as in my case, file extension was "file_name.tpl" , but it save it as "file_name.tpl.txt".

That was all, hope it could help someone!!!

No comments:

Post a Comment