X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=lib%2Fencodings;h=75ae8f3d0dccb2016ecf337ede1c42234263aae9;hb=647b4efb1eee97922421f60018c65829f601571e;hp=66d571231e45e9eadec807b1dbf4a463607827ce;hpb=dcc4d58b6644c01061dbd47b7a4be7f9186a992f;p=lyx.git diff --git a/lib/encodings b/lib/encodings index 66d571231e..75ae8f3d0d 100644 --- a/lib/encodings +++ b/lib/encodings @@ -3,11 +3,28 @@ # Note that you can only add singlebyte encodings to this file. # LyX does not support the output of multibyte encodings (e.g. utf16). -# It does support singlebyte encodings with variable with (e.g. utf8). +# It does support singlebyte encodings with variable width (e.g. utf8). # These are marked with the "variable" keyword. # Fixed width encodings are marked with the "fixed" keyword. - -# Syntax: Encoding fixed|variable End +# The code points of TeX control characters like {, } and \ can occur in the +# second byte of some variable width encodings. These encodings must not be +# set as document encodings and are marked with the "variableunsafe" keyword. +# They are only needed for proper tex2lyx import. + +# Most encodings require loading a latex package such as "inputenc" or "CJK". +# There is no "japanese" latex package, rather this keyword indicates to LyX +# to switch the buffer format and use platex instead of standard (pdf)latex. +# In this case, TeX control characters in high bytes is not a problem. +# The invocation is platex -kanji= + +# Syntax: Encoding End + +# LyX name: Name used by the file format and in lib/languages. Must be unique! +# LaTeX name: Used in the latex export or passed to platex as command-line switch. +# GUI name: Displayed in document settings. +# iconv name: Used by iconv. +# width: One of fixed, variable, or variableunsafe (see above). +# package: One of none, inputenc, CJK, or japanese (see above). # encodings used by inputenc.sty @@ -29,7 +46,7 @@ End Encoding iso8859-2 latin2 "Central European (ISO 8859-2)" ISO-8859-2 fixed inputenc End -Encoding iso8859-3 latin3 "Middle European (ISO 8859-3)" ISO-8859-3 fixed inputenc +Encoding iso8859-3 latin3 "South European (ISO 8859-3)" ISO-8859-3 fixed inputenc End Encoding iso8859-4 latin4 "Baltic (ISO 8859-4)" ISO-8859-4 fixed inputenc @@ -42,6 +59,7 @@ End Encoding iso8859-6 8859-6 "Arabic (ISO 8859-6)" ISO-8859-6 fixed inputenc End +# Not standard, see http://ctan.org/tex-archive/language/greek/greek-inputenc Encoding iso8859-7 iso-8859-7 "Greek (ISO 8859-7)" ISO-8859-7 fixed inputenc End @@ -61,6 +79,9 @@ End Encoding iso8859-16 latin10 "South-Eastern European (ISO 8859-16)" ISO-8859-16 fixed inputenc End +Encoding applemac applemac "Western European (Macintosh Roman)" Macintosh fixed inputenc +End + Encoding cp437 cp437 "DOS (CP 437)" CP437 fixed inputenc End @@ -95,6 +116,7 @@ End Encoding cp1251 cp1251 "Cyrillic (CP 1251)" CP1251 fixed inputenc End +# "ansinew" is harcoded as a synonym of this (see Encodings::fromLaTeXName) Encoding cp1252 cp1252 "Western European (CP 1252)" CP1252 fixed inputenc End @@ -108,7 +130,7 @@ End Encoding cp1257 cp1257 "Baltic (CP 1257)" CP1257 fixed inputenc End -Encoding koi8 koi8-r "Cyrillic (KOI8-R)" KOI8-R fixed inputenc +Encoding koi8-r koi8-r "Cyrillic (KOI8-R)" KOI8-R fixed inputenc End Encoding koi8-u koi8-u "Cyrillic (KOI8-U)" KOI8-U fixed inputenc @@ -127,16 +149,19 @@ End # Bg5+, GBt # See the NOTES file of libiconv for details. -# The following encodings can't be handled directly, because the code points -# of TeX control characters like {, } and \ can occur in the second byte: - # For traditional chinese -#Encoding big5 Bg5 "Chinese (traditional) (Big5)" BIG5 variable CJK -#End +Encoding big5 Bg5 "Chinese (traditional) (Big5)" BIG5 variableunsafe CJK +End # For japanese -#Encoding shift-jis SJIS "Japanese (CJK) (SJIS)" SJIS variable CJK -#End +# We use CP932 and not SJIS, since it is a super set of SJIS except that it +# translates SJIS 0x5c to U+005C (REVERSE SOLIDUS aka backslash) instead of +# U+00A5 (YEN SIGN). Strictly speaking this is wrong, but there is a long +# standing confusion which translation is correct, and using CP932 is also +# consistent with the SJIS example file /doc/latex/cjk/examples/SJIS.tex +# of the CJK package. The CP932 extensions over SJIS do not matter here. +Encoding shift-jis SJIS "Japanese (CJK) (SJIS)" CP932 variableunsafe CJK +End # The following encodings need hardcoded support of the encodable unicode # range, but are known by iconv: @@ -171,13 +196,15 @@ End # encodings that do not use a package -# Traditional Japanese TeX programs require neither CJK nor inputenc -# package. -Encoding euc-jp-plain EUC-JP-pLaTeX "Japanese (non-CJK) (EUC-JP)" EUC-JP variable none +# Traditional Japanese TeX programs require the japanese package. +# that is incompatible with CJK and inputenc. +Encoding euc-jp-platex euc "Japanese (pLaTeX) (EUC-JP)" EUC-JP variable japanese End -Encoding jis-plain JIS-pLaTeX "Japanese (non-CJK) (JIS)" ISO-2022-JP variable none +Encoding jis-platex jis "Japanese (pLaTeX) (JIS)" ISO-2022-JP variable japanese End -Encoding shift-jis-plain SJIS-pLaTeX "Japanese (non-CJK) (SJIS)" CP932 variable none +Encoding shift-jis-platex sjis "Japanese (pLaTeX) (SJIS)" CP932 variable japanese +End +Encoding utf8-platex utf8 "Japanese (pLaTeX) (UTF8)" UTF-8 variable japanese End # This one needs hardcoded support, since the inputenc package does not know @@ -195,4 +222,3 @@ End # Pure 7bit ASCII encoding (partially hardcoded in LyX) Encoding ascii ascii "ASCII" ascii fixed none End -