NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
Using special chars in files


Joined: 24 Sep 2010
Posts: 6
Location: Germany
Reply with quote
Hi,
My files were previously edited with Programmers Notepad. These files contain typical German / European Characters like ü and ö (if not readable: the html entities are ü and ö) and also the euro sign.
Now that I open these files in PhpEdit, these characters are replaced by something unreadable. Wenn I correct then, they are readable in the editor, but when shown in the web two unreadable characters are shown. I assume it has to do with encoding, but how to solve this?

Many thanks,

Ernest
View user's profileFind all posts by ErnestSend private message


Joined: 18 May 2006
Posts: 61
Reply with quote
Try to specify correct character encoding in open dialog ("File Encoding" combobox).
View user's profileFind all posts by mdegtyarevSend private message
Using special chars in files


Joined: 24 Sep 2010
Posts: 6
Location: Germany
Reply with quote
This would implicate not using the project list to open a file. This is no real solution. Also the question remains: what is the correct encoding for files previously created in plain text editors such as Programmers Notepad and others on windows systems.
View user's profileFind all posts by ErnestSend private message


Joined: 11 Apr 2010
Posts: 90
Location: Prague, Czech Republic
Reply with quote
That would depend on your system and in case of Windows and on your country. Standard english windows codepage is windows-1252 (aka cp-1252). If you use other language than english in Europe it is possible that your Windows natively use windows-1251 (aka cp-1251) or windows-1252 (aka cp-1252). I suggest you to go to wikipedia and search for the codepages mentioned, there is a list of countries, which uses which encoding.
To answer your question, documents created on Windows using notepad (or similar editing tool) is natively in one of the codepages above. If you select that codepage when opening the file in phpEd, it should open correctly then.
View user's profileFind all posts by fibizaSend private message
Using special chars in files


Joined: 24 Sep 2010
Posts: 6
Location: Germany
Reply with quote
Many thanks for this answer.

Meanwhile I've found a solution to avoid this problem at all times. I write all code using html entities and use the functions html_entity_decode() and htmlentities() whenever needed. I think this is the more bullet-proof solution.


Many thanks,

Ernest
View user's profileFind all posts by ErnestSend private message


Joined: 11 Apr 2010
Posts: 90
Location: Prague, Czech Republic
Reply with quote
Sure it might be a solution, but writing everithing using entities is a tiresome job. Also using htmlentities requires also proper character set to be selected, otherwise the encoding would be corrupted anyway. I would suggest to use UTF-8 (for non-Japanese, Chinese, etc. text) , which covers most problems and is widely used.
View user's profileFind all posts by fibizaSend private message
Using special chars in files
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic