How do I determine file encoding in OS X?

后端 未结 15 993
死守一世寂寞
死守一世寂寞 2020-11-29 15:12

I\'m trying to enter some UTF-8 characters into a LaTeX file in TextMate (which says its default encoding is UTF-8), but LaTeX doesn\'t seem to understand them.

Runn

15条回答
  •  野性不改
    2020-11-29 15:52

    Which LaTeX are you using? When I was using teTeX, I had to manually download the unicode package and add this to my .tex files:

    % UTF-8 stuff
    \usepackage[notipa]{ucs}
    \usepackage[utf8x]{inputenc}
    \usepackage[T1]{fontenc}
    

    Now, I've switched over to XeTeX from the TeXlive 2008 package (here), it is even more simple:

    % UTF-8 stuff
    \usepackage{fontspec}
    \usepackage{xunicode}
    

    As for detection of a file's encoding, you could play with file(1) (but it is rather limited) but like someone else said, it is difficult.

提交回复
热议问题