I just got a new system, Windows 7 Home Premium, installed Notepad++ and used it for a few days. I wrote some html/php files in Chinese, saved as UTF-8 without BOM. Uploaded to server and tested, all is well, until now.

Somehow, Notepad++ would not display the chinese characters in the editor anymore and all it shows are squares. Playing with the encoding conversions etc. doesn't help. So far, it felt like a Notepad++ bug.

Then I downloaded and installed Komodo edit. Same thing happened. Copying and paste chinese text from a chinese website like sohu.com into the editor will show squares as well.

Then I try notepad.exe, same issue. But it works in Microsoft Word and Wordpad.

The only big thing I did before this issue crops up is installing SQL Management Studio 2008 x86. Would this have any effect on the system? Maybe it changed the database locale and everything else?

Anyone have any idea how to fix this? I remember in older versions of Windows, there is an option in Regional Language settings to "extend language settings to other programs" something like that. But I cannot find it anymore in Windows 7.

EDIT: I found http://www.sevenforums.com/general-discussion/186507-chinese-characters-display-squares-text-editors.html which says to create a new profile. I haven't try. But to go that way is ridiculous....


saved as UTF-8 without BOM

Windows applications typically rely on the BOM to identify the encoding of a Unicode file.

Most of the applications allow you to specify an encoding in their "File, Open" dialogue. If you use that you shouldn't have a problem.

|improve this answer|||||
  • My experience is that HTML/PHP pages when saved with BOM does not display corrrectly with "content="text/html; charset=UTF-8". In any case, I think this is a windows bug because as i mentioned, previously it worked, just not now. Maybe someone knows a KB related to this issue? – Jake Nov 27 '11 at 13:43
  • See superuser.com/q/221593/52492. I'd check the encoding of your file (post a small hex dump here) and if necessary use something like iconv to change the encoding back to UTF-8 if it has got changed somehow. It is conceivable that adding an MS app could have changed the (advapi?) DLL containing the isTextUnicode() function and thus affected how Windows apps guess encoding in the absence of a BOM. You should still be able to load the files correctly in the file open dialogue – RedGrittyBrick Nov 27 '11 at 14:22
  • I opened the files originally created in Notepad++, with notepad.exe with the encoding settings as you advised. but the decoding seems to fail. still garbled text or bunch of "????" – Jake Nov 27 '11 at 14:29
  • please see my answer if interested. Thanks for far for your help. The answer to superuser.com/q/221593/52492 was insightful and good information. Thank you. – Jake Nov 27 '11 at 14:37

Set the system locale to Chinese (PRC) > restart computer > set back to desired locale > restart computer should reset unicode settings for applications. some locale other than Chinese (PRC) might work too.

This allows me to type and display chinese text in notepad but existing files in UTF-8 (with or without) BOM seems to be permanantly corrupted... any one knows how to revive them? no way to revive I think. =(

0000-0520:  76 3e 0a 09-09 09 3c 64-69 76 20 69-64 3d 22 63  v>....<d iv.id="c
0000-0530:  6f 6c 2d 74-77 6f 22 3e-0a 09 09 09-09 3c 64 69  ol-two"> .....<di
0000-0540:  76 20 63 6c-61 73 73 3d-22 73 65 63-74 69 6f 6e  v.class= "section
0000-0550:  22 3e 0a 09-09 09 09 09-3c 70 3e 3f-3f 3f 3f 3f  ">...... <p>?????
0000-0560:  3f 3f 3f 3f-3f 3f 3f 3f-3f 3f 3f 3f-3f 3f 3f 3f  ???????? ????????
0000-0570:  3f 32 30 30-33 3f 3f 3f-3f 3f 3f 3f-3f 3f 3f 3f  ?2003??? ????????
0000-0580:  3f 3f 3f 3f-3f 3f 3f 3f-3f 3f 3f 3f-3f 3f 3f 3f  ???????? ????????
0000-0590:  3f 3f 3f 3f-3f 3f 3f 3f-3f 3f 3f 3f-3f 3f 3f 3f  ???????? ????????
0000-05a0:  3f 3f 3f 3f-3f 3f 3f 3f-3f 3f 3f 3f-3f 3f 3f 3f  ???????? ????????
0000-05b0:  3f 3f 3f 3f-3f 3f 3f 3f-3f 3f 3f 3f-3f 3f 3f 3f  ???????? ????????
0000-05c0:  3f 3f 3f 3f-3f 3f 3f 3c-2f 70 3e 0a-09 09 09 09  ???????< /p>.....
0000-05d0:  09 3c 74 61-62 6c 65 20-63 6c 61 73-73 3d 22 63  .<table. class="c
0000-05e0:  6f 6e 74 61-63 74 22 3e-0a 09 09 09-09 09 3c 74  ontact"> ......<t
0000-05f0:  72 3e 3c 74-68 20 63 6f-6c 73 70 61-6e 3d 22 32  r><th.co lspan="2
0000-0600:  22 3e 3f 3f-3f 3f 3c 2f-74 68 3e 3c-2f 74 72 3e  ">????</ th></tr>
0000-0610:  0a 09 09 09-09 09 3c 74-72 3e 3c 74-64 20 63 6f  ......<t r><td.co
|improve this answer|||||
  • "any one knows how to revive them?" is a question not an answer. Please either ask a new question (best) or update your original question (probably inappropriate). If you put questions in "Answers" they'll probably get flagged for moderator attention as "not an answer" – RedGrittyBrick Nov 27 '11 at 14:37
  • It's just that... my answer/solution/fix is not perfect as existing files are permanantly corrupted. The "how to revive" was just to ask for a better answer that will preserve existing files. otherwise, most people will come and go, seeing that I answered my own question. anyhow, I strike of that line already. – Jake Nov 27 '11 at 14:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.