[OS X TeX] TeXShop 2.14 does not display saved Chinese characters correctly

Herbert Schulz herbs at wideopenwest.com
Wed Dec 5 22:12:53 CET 2007


On Dec 5, 2007, at 3:00 PM, Jung-Tsung Shen wrote:

> I am using TeXShop (2.14) on OS 10.4.11.
>
> The document containing Chinese characters can be compiled and  
> displayed correctly using CJK package now (see previous thread).  
> However, when the file is saved, and reopened, the characters become  
> random codes (or, codes), rather than the original typed characters.  
> This is true regardless which method (UTF-8, Chinese ...) is used to  
> save.
>
> The previous version of TeXShop seems to not have this problem. I  
> remember I tested this before following the discussions on this  
> forum using xeLaTeX, and the saved documents containing Chinese  
> characters show up fine when reopened.
>
> I suspect this is also true for other language such as Japanese or  
> Korean, but I haven't tested.
>
> JT


Howdy,

Do you have a line near the top of the file

%%!TEX encoding = UTF-8 Unicode

(assuming you are trying to save in utf8)? If you don't have the line  
the file was possibly saved in some other encoding. What is the  
default encoding you are using? (Go to TeXShop->Preferences->Document  
Tab and the Encoding drop down menu.)

You should also have the corresponding command to LaTeX to tell it how  
the file is encoded when it is compiled;

\usepackage[utf8]{inputencoding}

if you are using utf8 encoding.

Also, changing it after the mess-up won't work! Sorry! Not only that,  
I believe that once it's saved under a particular encoding adding the  
line won't change it; you've got to do a Save As... and overwrite the  
old file. Maybe I'm wrong about that?

Good Luck,

Herb Schulz
(herbs at wideopenwest.com)





More information about the macostex-archives mailing list