views:

24

answers:

1

I am adding some Chinese text to a primarily English web page and am having trouble getting the characters to display properly. I've got the encoding set to UTF-8 in the meta content type tag, and I am copying/pasting the Chinese I was sent from a Word document. The text is still rendering as follows:

繁體中文版

rather than in Chinese characters:

繁體中文版

I'm sure it's an easy fix, but I'm lost as to how to make this happen.

Thanks very much for any help.

+1  A: 

just because the meta tag says that the encoding is UTF8, doesn't mean that the content (file) itself is in UTF8. I mean, if you have a file index.html, the file itself should be encoded as utf8.

To change the encoding of a file in lunix, you can use this command

iconv --from-code=ISO-8859-1 --to-code=UTF-8 ./index.html > ./newIndex.html

but i guess that you are working with windows... and the only way i know change the encoding in windows is the Notepad++

Hope this helps

pleasedontbelong
That makes sense. I've got my default page encoding set to UTF-8 when a new document is created in Dreamweaver (I'm on a mac) but it still doesn't seem to be encoding properly.
Alex
hmm one way to find out the "real" encoding of your page is to open it in firefox and change the encoding (View->Character Encoding) until you see the Chinese characters. Be careful when you do copy/paste, because when you copy some text in Big5 into a UTF8 file for exemple, the system won't make the conversion automatically. The correct way to proceed is: Find out the original encoding of your source, convert it somehow to UTF8 (or UTF16), then put it in your .html file. Good Luck
pleasedontbelong