Let's describe the details of ptexenc here!
(This page is successor of ptetexWiki:UTF-8support(5).)


For the Japanese language, three different character encodings—EUC-JP, ISO-2022-JP, and Shift_JIS (for short, EUC, JIS, and SJIS, respectively)—have been used, depending on system (used in traditional Linux® distributions, email transport system, and Windows®, resp.). Nowadays UTF-8 encoding is becoming popular. UTF-8 encoding is used as the default Japanese encoding for Fedora™, Ubuntu™, Mac OS® X, and so on.

ASCII Japanese pTeX[extlink] originally had three executable files for each of three traditional character encodings. Default encoding of your binary was determined when the binary was built (by ./configure script's option). If you would like to typeset the non-default encoding file, please execute ptex with -kanji=<the file's encoding> as 'ptex -kanji=sjis'. More precisely speaking, ISO-2022-JP files can handle well in any three default enconding package. You need to be careful not to mix files in EUC and SJIS encodings.

Some improvements were made so that one executable file could support three encodings, but they were not sufficient. To solve this issue, we have created a new library, named ‘ptexenc,’ which makes the encoding functions clear. We will illustrate what we did below.

Now, ptexenc provides UTF-8 encoding support. Internally, ptexenc change UTF-8 encoding texts to EUC-JP encoding if the letters are included in JIS X 0208 characters(?); if not, ptexenc expands the text in the form of "^^ab". This is because pTeX can only handle JIS X 0208 character set.

If you use pTeX + ptexenc with inputenc package (`utf8' option) and UTF/OTF package[extlink], you can typeset Unocode characters (e.g. Hangul, some Kanji variations) more directly. ...


Below are memos for editorial purpose, possibly in Japanese.

  • 日本語の一連の「UTF-8 対応」のページの内容は、逐一その時の「pTeX の UTF-8 対応」― 現在の形は "ptexenc" ― の実装やそれに関わる思考の説明であるのに対して、英文で書くべきもの、そして今ここに書こうとしているものは、現状の ptexenc の説明ということになるでしょう。現時点ではこの 2 つはほぼ同一ですが、将来 ptexenc の仕様変更があったら、前者「UTF-8 対応(5)」は多分更新されない(また新しいページができる)のに対し、後者はそれに合わせて更新されるべきものでしょう。さらに、ptexlive Wiki の「ptexenc}ページでは(パッケージに同梱される)取扱説明書が作られていますが、このページは、そこから参照される詳細な仕様説明書の性格を帯びるものと思われます。その辺を意識すると、このページも ptexlive Wiki の方に「ptexenc の仕様(または詳細)」等の題であった方がいいのかも知れません。-- ZR 2008-02-11
  • ptex に -kanji オプションがついたのは p3.0.1 と p3.0.4 の間、時期でいうと2002年10月のことのようです。JIS のファイルなら EUC/SJIS どちらの ptex でも読み込めますが、これも最初からではなく p2.1.5 (1997年) 以降のようで、それまではスタイルファイルも EUC や SJIS にしておく必要があったようです。(ptex215/ptexextra.c に input_line() が出現したことから判断しました。) -- 土村 2008-02-23 (土) 14:46:12
  • ついに新版ができましたね。いつもありがとうございます。ところで、このページの英文の説明には、日本語のエンコーディングが3種類あるよ、という説明がないのですが、やはりそれは文化を異にするする人たちのために説明しておいた方がよいのではないでしょうか?ついでに圧倒的に多そうなWindows環境ではSJISだよー的なコメントもあると親切かもしれません。必ずしも日常的に日本語を扱う人でなくてもPTeXliveを使うような事があるかもしれません。 -- 取りすがり2 2009-06-03 (水) 03:26:34
  • そういえばこのページも随分更新が止まっていました.論文に書いた文章があるので,少し活かせるかもしれません. -- kuroky 2009-06-03 (水) 22:58:48
  • アイデアありがとうございます。For the Japanese language, three different ... の文章、ちょうどいい説明になってますね。 「pTeX の扱える character set は JIS X 0208 の1種類」ということも (日本では空気のように当り前なことですが)、説明しておいたほうがいいかもしれませんね。 -- 土村 2009-06-04 (木) 01:04:35


トップ   編集 凍結 差分 バックアップ 添付 複製 名前変更 リロード   新規 一覧 単語検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2009-06-13 (土) 20:17:36 (5425d)