Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I am trying to read a Chinese file in Fedora 7. The file was encoded with UTF-16LE, viewable in XP machine called chinese16.txt. My Window XP has codepage 437. Then, using Notepad i saved the file as "save as UTF-8" and name it as chinese8.txt.
After copy the file to the Linux machine, where the default locale is en_US.utf8 (according to the "$ locale" command.
I searched on the web and tried changing the locale with localedef command to change the locale to zh_CN.UTF-8, and export LANG=zh_CN.UTF-8.
when trying to view the utf8 file, chinese8.txt, I could not see any content in that file. I am not sure what i did incorrectly.
Can you copy the original file? Look at "file chinese16.txt" and see if the encoding is detected.
There is a program called iconv that may be able to convert the file to utf8 or utf16. Then see if you can read it in kate or another editor.
yes. I also use iconv to convert the file. The file contain English word and Chinese words. After converting them to UTF-8, I can see only English word, but the Chinese characters are not viewable (blank)
Stick with the orginal chinese16.txt file - UTF-16 would be a common encoding of Unicode under Windows.
Iconv knows of this and will (should be able to) convert this to the Unix world UTF-8 encoding.
If you call inconv -l you'll see all the utf-variants listed, try to convert directly from the orginal to utf-8.
And the locale setting you chose (LANG) actually just sets things to show error messages and menus and things like that in chinese - you'll need "show me chinese characters" which would be LC_CTYPE. (character type). LC_COLLATE affects sorting but I don't know if this really does chinese dictionary sorting with radicals and strokes counted and so on.
So, export LC_CTYPE to the proper locale setting you've got available (locale -a) - and I'm not sure wether or not this is case-sensitive or not.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.