LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   Chinese encoding not encoding in kate (http://www.linuxquestions.org/questions/linux-software-2/chinese-encoding-not-encoding-in-kate-849735/)

linuxmandrake 12-12-2010 05:00 AM

Chinese encoding not encoding in kate
 
I saved a plain text file with UTF8 encoding. I need to be able to copy and paste chinese characters into the xhtml. It doesn't seem to save it properly as when I reopen the file after saving all the chinese characters gets encoded into garbage text. What am I doing wrong?

rikijpn 12-12-2010 08:50 AM

I don't use kate, but I don't think it's an encoding problem. How did you read the file and get garbage?
You can use the "file" command to check a file's encoding.
Code:

file filename
This would return
Code:

filename:        UTF-8 Unicode text
On Japanese(chinese and korean too) languages properly encoded in unicode.

If it's not correctly encoded maybe you have an input problem... Try another editor to check?

If it's correctly encoded, then the problem should be the method in which you are reading the file, I guess.
If you checked the text in a browser remember to put the
Code:

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="zh" lang="zh">
and
Code:

<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
Telling the browser the language and encoding information to view the page properly.

I've only written pages in Japanese but they should be kinda the same method.


All times are GMT -5. The time now is 09:15 PM.