The Unicode HOWTO <author>Bruno Haible, <htmlurl url="mailto:haible@clisp.cons.org" name="<haible@clisp.cons.org>"> <date>v0.15, 25 January 2000 <trans>早川 仁, <htmlurl url="mailto:cz8cb01@linux.or.jp" name="<cz8cb01@linux.or.jp>"> <tdate>V0.15j, 2000年01月01日 <abstract> <!-- This document describes how to change your Linux system so it uses UTF-8 as text encoding. - This is work in progress. Any tips, patches, pointers, URLs are very welcome. --> このドキュメントは UTF-8 をテキストエンコーディングとして使用するよう に Linux システムを変更する方法について説明しています。この文書は現在作業中 ですから tips、パッチ、助言、URL を大歓迎します。 </abstract> <toc> <sect>翻訳について <p> <sect1>訳語統一 <p> 訳語は、当文書の中では以下で統一してあります。 <descrip> <tag/character set/文字セット <tag/script/用字 <tag/locale/ロケール <tag/wide character/ワイド文字 </descrip> 用字(script)とは 1 つ以上の言語の表記の方法で使用する、図形文字の集合のこと だそうです。 たとえば「ひらがな」「カタカナ」「ラテン文字(アルファベット)」といった 文字の種類を指します。日本語は「ひらがな」「カタカナ」「ラテン文字」 「日本漢字」といったように多数の用字を混在して使う言語ですが、 英語は通常ラテン文字しか使いません。 <sect1>参考文献 <p> 翻訳にあたり、以下の文献を参考としました。 <itemize> <item>「国際化プログラミング I18Nハンドブック」清兼義弘・末廣陽一/編著 <item>BSD magazine 1999 No.2 「BSD における国際化」わたなべごう/著 </itemize> <sect1>翻訳者謝辞 <p> 翻訳の際には以下の方々に多数の有益なコメント、校正をしていただきました。 ありがとうございました。 <itemize> <item>佐藤亮一さん <item>藤原輝嘉さん <item>武井伸光さん <item>斎藤幹さん <item>森本淳さん <item>中野武雄さん </itemize> <sect1>最新版の原文のありか <p> オリジナルの Unicode-HOWTO 最新版は <url url="ftp://ftp.ilog.fr/pub/Users/haible/utf8/Unicode-HOWTO.html"> にあります。 <sect> <!-- Introduction --> イントロダクション <p> <sect1> <!-- Why Unicode? --> なぜ Unicode を使うのですか? <p> <!-- People in different countries use different characters to represent the words of their native languages. Nowadays most applications, including email systems and web browsers, are 8-bit clean, i.e. they can operate on and display text correctly provided that it is represented in an 8-bit character set, like ISO-8859-1. --> 異なった国の人々は、それぞれの母国語の単語を表現するのに異なった文字を使 用しています。現在では email システムや web ブラウザなど、ほとんどのアプ リケーションは 8 ビットクリーンです。つまり ISO-8859-1 のような 8 ビット 文字セットで表現されるテキストの取り扱いや表示を正しく行えるということで す。 <!-- There are far more than 256 characters in the world - think of cyrillic, hebrew, arabic, chinese, japanese, korean and thai -, and new characters are being invented now and then. The problems that come up for users are: --> 世界には 256 よりも遥かに多くの文字があります。例えばキリル文字、ヘブラ イ語、アラビア語、中国語、日本語、韓国語、タイ語などです。新しい文字も時々 作られています。利用者に問題になってくることには次のようなものがあります。 <itemize> <item> <!-- It is impossible to store text with characters from different character sets in the same document. For example, I can cite russian papers in a German or French publication if I use TeX, xdvi and PostScript, but I cannot do it in plain text. --> 一つの文書の中に異なる文字セットの文字を混在させることができない場合。例 をあげると TeX, xdvi, PostScript を使っている場合には、ドイツ語やフラン ス語の文書でロシア語での引用をすることができますが、ただのテキストファイ ルでは無理です。 <item> <!-- As long as every document has its own character set, and recognition of the character set is not automatic, manual user intervention is inevitable. For example, in order to view the homepage of the XTeamLinux distribution <htmlurl url="http://www.xteamlinux.com.cn/" name="http://www.xteamlinux.com.cn/"> I had to tell Netscape that the web page is coded in GB2312. --> それぞれの文書が固有の文字セットを持ち、文字セットの認識が自動でなければ、 ユーザーが介在してこれを手動で行わなければなりません。例えば XTeamLinux distribution のホームページ <htmlurl url="http://www.xteamlinux.com.cn/" name="http://www.xteamlinux.com.cn/"> を見るためには、Netscape にその web ページは GB2312 コードであると指示する必要があります。 <!-- ここのホームページは本来の意味だから、web site とかには おきかえません :-) --> <item> <!-- New symbols like the Euro are being invented. ISO has issued a new standard ISO-8859-15, which is mostly like ISO-8859-1 except that it removes some rarely used characters (the old currency sign) and replaced it with the Euro sign. If users adopt this standard, they have documents in different character sets on their disk, and they start having to think about it daily. But computers should make things simpler, not more complicated. --> ユーロのような新しいシンボルも生み出されています。ISO は新しい標準 ISO-8859-15 を発表(issue)しました。これはほとんど ISO-8859-1 と同じです が、ほとんど使われない文字(古い通貨のマーク)を取り除いて、ユーロのマーク と置き換えました。ユーザーがこの標準を使用することにした場合、ディスク内 に違った文字セットの文書を持つことになります。つまり、文字セットのことを 常に考慮する日々のはじまりということです。ですがコンピュータは物事をシン プルにするためのものであり、より複雑にするものではありません。 </itemize> <!-- The solution of this problem is the adoption of a world-wide usable character set. This character set is Unicode <htmlurl url="http://www.unicode.org/" name="http://www.unicode.org/">. For more info about Unicode, do `<tt>man 7 unicode</tt>' (manpage contained in the man-pages-1.20 package). --> この問題を解決するには、ワールドワイドに使用できる文字セットを使うことで す。その文字セットとは Unicode <htmlurl url="http://www.unicode.org/" name="http://www.unicode.org/"> のことです。Unicode に関する詳細は `<tt>man 7 unicode</tt>' を実行してください。(manpage は man-pages-1.20 パッ ケージに含まれています) <sect1> <!-- Unicode encodings --> Unicode のエンコーディング <p> <!-- This reduces the user's problem of dealing with character sets to a technical problem: How to transport Unicode characters using the 8-bit bytes? 8-bit units are the smallest addressing units of most computers and also the unit used by TCP/IP network connections. The use of 1 byte to represent 1 character is, however, an accident of history, caused by the fact that computer development started in Europe and the U.S. where 96 characters were found to be sufficient for a long time. --> Unicode エンコーディングを使うと、文字セットを扱うユーザープログラムの問 題は、「どうやって 1 オクテット(8 ビット)で Unicode 文字を送るのか」とい う技術的な問題だけになります。8 ビットという単位は、多くのコンピュータで、 アドレスを表現する最小単位です。またこの 8 ビットという単位は、TCP/IP ネッ トワークでのコネクションにも使用されています。1 文字を表現するのに 1 バ イトを使用するというのは歴史的な偶然であり、これはコンピュータの開発がヨー ロッパとアメリカで始まったことによります。これらの国々では長い間、96 種 類の文字で充分とされてきました。 <!-- There are basically four ways to encode Unicode characters in bytes: --> Unicode 文字をバイトでエンコードする方法には、通常 4 種類あります。 <descrip> <tag>UTF-8</tag> <!-- 128 characters are encoded using 1 byte (the ASCII characters). 1920 characters are encoded using 2 bytes (Roman, Greek, Cyrillic, Coptic, Armenian, Hebrew, Arabic characters). 63488 characters are encoded using 3 bytes (Chinese and Japanese among others). The other 2147418112 characters (not assigned yet) can be encoded using 4, 5 or 6 characters. For more info about UTF-8, do `<tt>man 7 utf-8</tt>' (manpage contained in the ldpman-1.20 package). --> 128 文字が 1 バイトでエンコードされます(ASCII 文字)。1920 文字が 2 バイ トでエンコードされます(ローマ字、ギリシャ文字、キリル文字、コプト語、ア ルメニア語、ヘブライ語、アラビア語の文字)。63488 文字が 3バイトでエンコー ドされます(中国語や日本語など)。残りの 2147418112 文字は 4 〜 6 バイトを 使ってエンコードすることができます(まだ割り当てられていません)。UTF-8 に 関する詳細は `<tt>man 7 utf-8</tt>' を実行してください。(manpage は ldpman-1.20 パッケージに含まれています) <tag>UCS-2</tag> <!-- Every character is represented as two bytes. This encoding can only represent the first 65536 Unicode characters. --> 全ての文字は 2 バイトで表現されます。このエンコーディングでは Unicodeの 始めの 65536 文字だけを表現できます。 <tag>UTF-16</tag> <!-- This is an extension of UCS-2 which can represent 1112064 Unicode characters. The first 65536 Unicode characters are represented as two bytes, the other ones as four bytes. --> これは UCS-2 の拡張で 1112064 の Unicode 文字を表現することができます。 Unicode の始めの 65536 文字は 2 バイトで、残りは 4 バイトで表現されます。 <tag>UCS-4</tag> <!-- Every character is represented as four bytes. --> 全ての文字は 4 バイトで表現されます。 </descrip> <!-- The space requirements for encoding a text, compared to encodings currently in use (8 bit per character for European languages, more for Chinese/Japanese/Korean), is as follows. This has an influence on disk storage space and network download speed (when no form of compression is used). --> テキストをエンコードするのに必要となる容量(ヨーロッパの言語では 1 文字あ たり 8ビットで、中国語、日本語、韓国語ではより多くのビット数)を、現在使 用されているエンコーディングと比べたものが以下になります。これはディスク で使用する容量や、ネットワークでのダウンロード速度に影響します(圧縮をし ていない場合)。 <descrip> <tag>UTF-8</tag> <!-- No change for US ASCII, just a few percent more for ISO-8859-1, 50% more for Chinese/Japanese/Korean, 100% more for Greek and Cyrillic. --> US ASCII なら変化なし、ISO-8859-1 なら数パーセント増え、中国語、日本語、 韓国語では 1.5 倍、ギリシャ文字やキリル文字では 2 倍になります。 <!-- <tag>UCS-2 and UTF-16</tag> No change for Chinese/Japanese/Korean. 100% more for US ASCII and ISO-8859-1, Greek and Cyrillic. --> <tag>UCS-2 および UTF-16</tag> 中国語、日本語、韓国語では変化なし、ASCII、ISO-8859-1、ギリシャ文字、 キリル文字では 2 倍になります。 <tag>UCS-4</tag> <!-- 100% more for Chinese/Japanese/Korean. 300% more for US ASCII and ISO-8859-1, Greek and Cyrillic. --> 中国語、日本語、韓国語では 2倍、ASCII、ISO-8859-1、ギリシャ文字、キリル 文字では 3 倍になります。 </descrip> <!-- Given the penalty for US and European documents caused by UCS-2, UTF-16, and UCS-4, it seems unlikely that these encodings have a potential for wide-scale use. The Microsoft Win32 API supports the UCS-2 encoding since 1995 (at least), yet this encoding has not been widely adopted for documents - SJIS remains prevalent in Japan. --> UCS-2, UTF-16, UCS-4 で US やヨーロッパの文書を書く場合にはASCII や ISO-8859-1 で書いたときよりもサイズが大きくなることがあるため、それらの エンコーディングが広く使われることはなさそうです。 Microsoft の Win32 API は UCS-2 エンコーディングを(少なくとも) 1995 年からサポートしていま すが、UCS-2は文書を記述するのに広く使われてはいません。日本ではシフト JIS がいまだ一般的です。 <!-- UTF-8 on the other hand has the potential for wide-scale use, since it doesn't penalize US and European users, and since many text processing programs don't need to be changed for UTF-8 support. --> 一方、US やヨーロッパの利用者にはペナルティがなく、また多くのテキスト操 作を行うプログラムは UTF-8 サポートのための変更が必要ないので、UTF-8 は 広く使われる可能性があります。 <!-- In the following, we will describe how to change your Linux system so it uses UTF-8 as text encoding. --> これから、テキストのエンコーディングとして UTF-8 を使うように Linux シス テムを変更する方法について説明していきます。 <sect2> <!-- Footnotes for C/C++ developers --> C/C++ 開発者への補足説明 <p> <!-- The Microsoft Win32 approach makes it easy for developers to produce Unicode versions of their programs: You "#define UNICODE" at the top of your program and then change many occurrences of `<tt>char</tt>' to `<tt>TCHAR</tt>', until your program compiles without warnings. The problem with it is that you end up with two versions of your program: one which understands UCS-2 text but no 8-bit encodings, and one which understands only old 8-bit encodings. --> Microsoft が Win32 API で取っているアプローチでは、開発者が Unicode 版の プログラムを作成することは簡単です。"#define UNICODE" をプログラムの 先頭で宣言して、コンパイルエラーがなくなるまで `<tt>char</tt>' を `<tt>TCHAR</tt>' へ変更します。この方法の問題は、最終的に 2 つのバージョ ンのプログラムができてしまうことです。1 つは UCS-2 のテキストを扱えます が、8 ビットのエンコーディングは駄目です。もう 1 つは旧来の 8 ビットエン コーディングしか扱えません。 <!-- Moreover, there is an endianness issue with UCS-2 and UCS-4. The IANA character set registry <htmlurl url="http://www.isi.edu/in-notes/iana/assignments/character-sets" name="http://www.isi.edu/in-notes/iana/assignments/character-sets"> says about ISO-10646-UCS-2: "this needs to specify network byte order: the standard does not specify". Network byte order is big endian. And RFC 2152 is even clearer: "ISO/IEC 10646-1:1993(E) specifies that when characters the UCS-2 form are serialized as octets, that the most significant octet appear first." Whereas Microsoft, in its C/C++ development tools, recommends to use machine-dependent endianness (i.e. little endian on ix86 processors) and either a byte-order mark at the beginning of the document, or some statistical heuristics(!). --> さらに UCS-2 と UCS-4 にはエンディアンの問題があります。The Internet Assigned Numbers Authority (IANA) character set registry <htmlurl url="http://www.isi.edu/in-notes/iana/assignments/character-sets" name="http://www.isi.edu/in-notes/iana/assignments/character-sets"> は ISO-10646-UCS-2 についてこのように述べています:<quote>「これにはネット ワークバイトオーダーを指定する必要がある: 標準は定められていない」 </quote> ネットワークバイトオーダーはビッグエンディアンです。また RFC 2152 に、より明確に記述されています:「ISO/IEC 10646-1:1993(E) にはUCS-2 の文字がオクテットで表現される時には、最も大きいオクテットが始めに来ると 示されています」ところが Microsoftは自社の C/C++ 開発ツールではマシン依 存のエンディアン(つまり intel x86 系のプロセッサではリトルエンディアン) を使用することと、ドキュメントの始めにバイトオーダーのマークもしくは統計 的検出法(statistical heuristics)を使用することを推奨しています。 (訳注: heuristics とは例えば、バイトオーダが入れ替わっているような状態 では何の手がかりもないと、どんなキャラクタセットかわからない。でも例えば 日本語の文章の場合には統計的に、'、' や `。' などはそれなりの頻度で現れ ると予測されるので、もしそうなら日本語じゃないかと判断するようなことです) <!-- The UTF-8 approach on the other hand keeps `<tt>char*</tt>' as the standard C string type. As a result, your program will handle US ASCII text, independently of any environment variables, and will handle both ISO-8859-1 and UTF-8 encoded text provided the LANG environment variable is set accordingly. --> それに対して UTF-8 のアプローチでは、`<tt>char*</tt>' を C の標準の文字 列型のままとしています。結果としてプログラムは ASCII テキストを環境変数 に関わらず扱うことができ、また LANG 環境変数を指定すれば ISO-8859-1 と UTF-8 でエンコードされたテキストをも扱うことができます。 <sect1> <!-- Related resources --> 関連文書 <p> <!-- Markus Kuhn's very up-to-date resource list: --> Markus Kuhn の最新リソースリスト: <itemize> <item> <htmlurl url="http://www.cl.cam.ac.uk/~mgk25/unicode.html" name="http://www.cl.cam.ac.uk/~mgk25/unicode.html"> <item> <htmlurl url="http://www.cl.cam.ac.uk/~mgk25/ucs-fonts.html" name="http://www.cl.cam.ac.uk/~mgk25/ucs-fonts.html"> </itemize> <!-- Roman Czyborra's overview of Unicode, UTF-8 and UTF-8 aware programs: --> Roman Czyborra の Unicode、UTF-8 および UTF-8 対応プログラムのオーバービュー: <htmlurl url="http://czyborra.com/utf/#UTF-8" name="http://czyborra.com/utf/#UTF-8"> <!-- Some example UTF-8 files: --> UTF-8 ファイルの例: <itemize> <item> <!-- In Markus Kuhn's ucs-fonts package: --> Markus Kuhn の ucs-fonts パッケージ <htmlurl url="http://www.cl.cam.ac.uk/~mgk25/ucs/examples/quickbrown.txt" name="quickbrown.txt">, <htmlurl url="http://www.cl.cam.ac.uk/~mgk25/ucs/examples/UTF-8-test.txt" name="UTF-8-test.txt">, <htmlurl url="http://www.cl.cam.ac.uk/~mgk25/ucs/examples/UTF-8-demo.txt" name="UTF-8-demo.txt">. <item> <htmlurl url="ftp://ftp.cs.su.oz.au/gary/x-utf8.html" name="ftp://ftp.cs.su.oz.au/gary/x-utf8.html"> <item> <!-- The file <tt>iso10646</tt> in the Kosta Kostis' trans-1.1.1 package --> Kosta Kostis の trans-1.1.1 パッケージの <tt>iso10646</tt> ファイル <htmlurl url="ftp://ftp.nid.ru/pub/os/unix/misc/trans111.tar.gz" name="ftp://ftp.nid.ru/pub/os/unix/misc/trans111.tar.gz"> <item> <htmlurl url="ftp://ftp.dante.de/pub/tex/info/lwc/apc/utf8.html" name="ftp://ftp.dante.de/pub/tex/info/lwc/apc/utf8.html"> <item> <htmlurl url="http://www.cogsci.ed.ac.uk/~richard/unicode-sample.html" name="http://www.cogsci.ed.ac.uk/~richard/unicode-sample.html"> </itemize> <sect> <!-- Display setup --> 表示の設定 <p> <!-- We assume you have already adapted your Linux console and X11 configuration to your keyboard and locale. This is explained in the Danish/International HOWTO, and in the other national HOWTOs: Finnish, French, German, Italian, Polish, Slovenian, Spanish, Cyrillic, Hebrew, Chinese, Thai, Esperanto. But please do not follow the advice given in the Thai HOWTO, to pretend you were using ISO-8859-1 characters (U0000..U00FF) when what you are typing are actually Thai characters (U0E01..U0E5B). Doing so will only cause problems when you switch to Unicode. --> ここでは、既に Linux のコンソールと X11 の設定を、使用しているキーボードと ロケールにあわせてあると仮定します。この方法は デンマーク/インターナショナル HOWTO や 他の国(Finnish(フィンランド), French(フランス), German(ドイツ), Italian (イタリア), Polish(ポーランド), Slovenian(スロベニア), Spanish(スペイン), Cyrillic(キリル), Hebrew(ヘブライ), Chinese(中国), Thai(タイ), Esperanto(エスペラント)) の HOWTO で説明されています。ただ、 Thai HOWTO で説明されている方法には従わないでください。ISO-8859-1 の 文字(U0000..U00FF) を使用してもタイ語の文字 (U0E01..U0E5B) になってしまいます。これは Unicode に変更するときに問題となります。 (訳注:日本語版のほとんどのディストリビューションでは既に設定済みですが、 もしまだであれば JF プロジェクトにある Keyboard-and-Console-HOWTO が役にたつでしょう) <sect1> <!-- Linux console --> Linux コンソール <p> <!-- I'm not talking much about the Linux console here, because on those machines on which I don't have xdm running, I use it only to type my login name, my password, and "xinit". --> ここでは Linux コンソールについてあまり多くは述べません。私が xdm を動か していないマシンを使う場合、単にログイン名とパスワードを入力して "xinit" を実行するだけだからです。 <!-- Anyway, the kbd-0.99 package <htmlurl url="ftp://sunsite.unc.edu/pub/Linux/system/keyboards/kbd-0.99.tar.gz" name="ftp://sunsite.unc.edu/pub/Linux/system/keyboards/kbd-0.99.tar.gz"> and a heavily extended version, the console-tools-0.2.2 package <htmlurl url="ftp://sunsite.unc.edu/pub/Linux/system/keyboards/console-tools-0.2.2.tar.gz" name="ftp://sunsite.unc.edu/pub/Linux/system/keyboards/console-tools-0.2.2.tar.gz"> contains in the kbd-0.99/src/ (or console-tools-0.2.2/screenfonttools/) directory two programs: `unicode_start' and `unicode_stop'. When you call `unicode_start', the console's screen output is interpreted as UTF-8. Also, the keyboard is put into Unicode mode (see "man kbd_mode"). In this mode, Unicode characters typed as Alt-x1 ... Alt-xn (where x1,...,xn are digits on the numeric keypad) will be emitted in UTF-8. If your keyboard or, more precisely, your normal keymap has non-ASCII letter keys (like the German Umlaute) which you would like to be CapsLockable, you need to apply the kernel patch <htmlurl url="ftp://ftp.ilog.fr/pub/Users/haible/utf8/linux-2.2.9-keyboard.diff" name="linux-2.2.9-keyboard.diff"> or <htmlurl url="ftp://ftp.ilog.fr/pub/Users/haible/utf8/linux-2.3.12-keyboard.diff" name="linux-2.3.12-keyboard.diff">. --> kbd-0.99 パッケージ <htmlurl url="ftp://sunsite.unc.edu/pub/Linux/system/keyboards/kbd-0.99.tar.gz" name="ftp://sunsite.unc.edu/pub/Linux/system/keyboards/kbd-0.99.tar.gz"> と、それをかなり拡張したバージョンである console-tools-0.2.2 パッケージ <htmlurl url="ftp://sunsite.unc.edu/pub/Linux/system/keyboards/console-tools-0.2.2.tar.gz" name="ftp://sunsite.unc.edu/pub/Linux/system/keyboards/console-tools-0.2.2.tar.gz"> には kbd-0.99/src/ (もしくは console-tools-0.2.2/screenfonttools/)ディレ クトリに二つのプログラム `unicode_start' と `unicode_stop' があります。 `unicode_start'を呼びだすと、コンソールのスクリーンへの出力は UTF-8と解 釈されます。またキーボードは Unicode モード("man kbd_mode" を参照)に入り ます。このモードでは、Alt-x1 〜 Alt-xn(x1 〜 xn はテンキー上の数値です) で入力された Unicode 文字は UTF-8 となります。あなたのキーボードに (正確 にはあなたの通常のキーマップに) 非 ASCII 文字のキー(たとえばドイツ語のウ ムラウト)があり、その文字をキャップスロックしたい場合には、カーネルパッ チ <htmlurl url="ftp://ftp.ilog.fr/pub/Users/haible/utf8/linux-2.2.9-keyboard.diff" name="linux-2.2.9-keyboard.diff"> もしくは <htmlurl url="ftp://ftp.ilog.fr/pub/Users/haible/utf8/linux-2.3.12-keyboard.diff" name="linux-2.3.12-keyboard.diff"> をあてる必要があります。 <!-- たしか特殊(アクセント)文字って、CapsLock してnakano... --> <!-- 入力するんだったよなぁ \"{u} と \"{U} の違いのことなのでは? --> <!-- You will want to use display characters from different scripts on the same screen. For this, you need a Unicode console font. The <htmlurl url="ftp://sunsite.unc.edu/pub/Linux/system/keyboards/kbd-0.99.tar.gz" name="ftp://sunsite.unc.edu/pub/Linux/system/keyboards/kbd-0.99.tar.gz"> and <htmlurl url="ftp://sunsite.unc.edu/pub/Linux/system/keyboards/console-data-1999.08.29.tar.gz" name="ftp://sunsite.unc.edu/pub/Linux/system/keyboards/console-data-1999.08.29.tar.gz"> packages contain a font (LatArCyrHeb-{08,14,16,19}.psf) which covers Latin, Cyrillic, Hebrew, Arabic scripts. It covers ISO 8859 parts 1,2,3,4,5,6,8,9,10 all at once. To install it, copy it to /usr/lib/kbd/consolefonts/ and execute "/usr/bin/setfont /usr/lib/kbd/consolefonts/LatArCyrHeb-14.psf". --> スクリーン上で同時に異なった種類の文字を表示する場合、Unicode コンソール のためのフォントが必要となります。<htmlurl url="ftp://sunsite.unc.edu/pub/Linux/system/keyboards/kbd-0.99.tar.gz" name="ftp://sunsite.unc.edu/pub/Linux/system/keyboards/kbd-0.99.tar.gz"> および <htmlurl url="ftp://sunsite.unc.edu/pub/Linux/system/keyboards/console-data-1999.08.29.tar.gz" name="ftp://sunsite.unc.edu/pub/Linux/system/keyboards/console-data-1999.08.29.tar.gz"> パッケージに含まれているフォント(LatArCyrHeb-{08,14,16,19}.psf) はラテン 語、キリル文字、ヘブライ語、アラビア語の文字をカバーします。つまりこれ一 つで ISO 8859 の 1,2,3,4,5,6,8,9,10 をカバーします。インストールするには /usr/lib/kbd/consolefonts/ へコピーし、<newline> "/usr/bin/setfont /usr/lib/kbd/consolefonts/LatArCyrHeb-14.psf" を実行します。 <!-- ここの <newline> は .txt 版の時に、コマンドと引数が違う行になってしまっ てわかりにくいから --> <!-- If you want cut&paste to work with UTF-8 consoles, you need the patch <htmlurl url="ftp://ftp.ilog.fr/pub/Users/haible/utf8/linux-2.3.12-console.diff" name="linux-2.3.12-console.diff"> from Edmund Thomas Grimley Evans and Stanislav Voronyi. --> カット & ペーストを UTF-8 のコンソールで動作させたいのであれば、 Edmund Thomas Grimley Evans と Stanislav Voronyi によるパッチ <htmlurl url="ftp://ftp.ilog.fr/pub/Users/haible/utf8/linux-2.3.12-console.diff" name="linux-2.3.12-console.diff"> が必要になります。 <sect1> <!-- X11 Foreign fonts --> X11 外国語フォント <p> <!-- Don't hesitate to install Cyrillic, Chinese, Japanese etc. fonts. Even if they are not Unicode fonts, they will help in displaying Unicode documents: at least Netscape Communicator 4 and Java will make use of foreign fonts when available. --> キリル文字、中国語、日本語などのフォントのインストールをためらう理由はあ りません。それらが Unicode フォントではないとしても、Unicode の文書を表 示する時に役立ちます。少くとも Netscape Communicator 4 と Java は、可能な 時には外国語のフォントを利用します。 <!-- The following programs are useful when installing fonts: --> 以下は、フォントをインストールする時に便利なプログラムです。 <itemize> <item> "mkfontdir directory" <!-- prepares a font directory for use by the X server, needs to be executed after installing fonts in a directory. --> は X サーバーが使用する font ディレクトリを準備します。 これはディレクトリにフォントをインストールした後に 実行する必要があります。 <item> "xset fp+ directory" <!-- adds a directory to the X server's current font path. To add a directory permanently, add a "FontPath" line to your /etc/XF86Config file, in section "Files". --> は X サーバーのカレントフォントパスに directory を追加します。恒久的にディ レクトリを追加するのであれば、/etc/XF86Config ファイルの "Files" セクショ ンに "FontPath" 行を追加します。 <item> "xset fp rehash" <!-- needs to be executed after calling mkfontdir on a directory that is already contained in the X server's current font path. --> を mkfontdir を呼びだしたあとに実行する必要があります。これはフォントパ スを現在値にリセットし、カレントフォントパスのフォントデータベースを X サーバに再読み込みさせます。 <!-- 大幅に意訳 :-) --> <item> "xfontsel" <!-- allows you to browse the installed fonts by selecting various font properties. --> で、インストールされている各種フォントのプロパティをマウスで選択して ブラウズすることができます。 <item> "xlsfonts -fn fontpattern" <!-- lists all fonts matching a font pattern. Also displays various font properties. In particular, "xlsfonts -ll -fn font" lists the font properties CHARSET_REGISTRY and CHARSET_ENCODING, which together determine the font's encoding. --> は fontpattern にマッチしている全てのフォントをリスト表示し、各種フォント のプロパティを表示します。"xlsfonts -ll -fn font" を実行すると、フォント プロパティ CHARSET_REGISTRY と CHARSET_ENCODING をリスト表示します。 これらのプロパティはフォントのエンコーディングを決定します。 <item> "xfd -fn font" <!-- displays a font page by page. --> はページ毎に font を表示します。 </itemize> <!-- The following fonts are freely available (not a complete list): --> 次のフォントは自由に利用できます(完全なリストではありません): <itemize> <item> <!-- The ones contained in XFree86, sometimes packaged in separate packages. For example, SuSE has only normal 75dpi fonts in the base `xf86' package. The other fonts are in the packages `xfnt100', `xfntbig', `xfntcyr', `xfntscl'. --> XFree86 に含まれるもの。別のパッケージになってるかもしれません。 例えば SuSE には普通の 75dpi フォントのみが 基本の `xf86' パッケージに入っています。その他のフォントはパッケージ `xfnt100', `xfntbig', `xfntcyr', `xfntscl' に含まれています。 <!-- キホソとか書きそうになったのは、IRC のやりスギか?(わら --> <item> <!-- The Emacs international fonts, <htmlurl url="ftp://ftp.gnu.org/pub/gnu/intlfonts/intlfonts-1.2.tar.gz" name="ftp://ftp.gnu.org/pub/gnu/intlfonts/intlfonts-1.2.tar.gz"> As already mentioned, they are useful even if you prefer XEmacs to GNU Emacs or don't use any Emacs at all. --> <htmlurl url="ftp://ftp.gnu.org/pub/gnu/intlfonts/intlfonts-1.2.tar.gz" name="ftp://ftp.gnu.org/pub/gnu/intlfonts/intlfonts-1.2.tar.gz"> の Emacs 国際フォント。既に言及されているように、GNU Emacs より XEmacs を好む場合や Emacs を使わない場合であっても、これらは役に立ちます。 </itemize> <sect1> <!-- X11 Unicode fonts --> X11 Unicode フォント <p> <!-- Applications wishing to display text belonging to different scripts (like Cyrillic and Greek) at the same time, can do so by using different X fonts for the various pieces of text. This is what Netscape Communicator and Java do. However, this approach is more complicated, because instead of working with `Font' and `XFontStruct', the programmer has to deal with `XFontSet', and also because not all fonts in the font set need to have the same dimensions. --> アプリケーションで異なる用字(例えばキリル文字やギリシャ文字)のテキストを 同時に表示するには、異なる X フォントを使うことによって可能になります。 これは Netscape Communicator と Java が行なっていることです。ですがこの 方法はより複雑です。プログラマーは `Font' と `XFontStruct' を利用するか わりに `XFontSet' を扱わなければならなく、その上さらにフォントセットの全 てのフォントが同じ文字幅を持っているわけではないからです。 <itemize> <item> <!-- Markus Kuhn has assembled fixed-width 75dpi fonts with Unicode encoding covering Latin, Greek, Cyrillic, Armenian, Georgian, Hebrew, Symbol scripts. They cover ISO 8859 parts 1,2,3,4,5,7,8,9,10,13,14,15 all at once. This font is required for running xterm in utf-8 mode. <htmlurl url="http://www.cl.cam.ac.uk/~mgk25/download/ucs-fonts.tar.gz" name="http://www.cl.cam.ac.uk/~mgk25/download/ucs-fonts.tar.gz"> --> Markus Kuhn は Unicode でエンコードされた固定幅の 75dpi フォントを作りました。これはラテン語、ギリシャ語、キリル文字、アルメニア語、 グルジア語、ヘブライ語、記号をカバーしています。つまり ISO 8859 の 1,2,3,4,5,7,8,9,10,13,14,15 全てを 1 つでカバーします。 このフォントは xterm を utf-8 モードで実行する必要があります。 <htmlurl url="http://www.cl.cam.ac.uk/~mgk25/download/ucs-fonts.tar.gz" name="http://www.cl.cam.ac.uk/~mgk25/download/ucs-fonts.tar.gz"> <item> <!-- Roman Czyborra has assembled an 8x16 / 16x16 75dpi font with Unicode encoding covering a huge part of Unicode. Download unifont.hex.gz and hex2bdf from <htmlurl url="http://czyborra.com/unifont/" name="http://czyborra.com/unifont/">. It is not fixed-width: 8 pixels wide for European characters, 16 pixels wide for Chinese characters. Installation instructions: --> Roman Czyborra は Unicode でエンコードされた 8x16 / 16x16 幅 75dpi フォントを作りました。これは Unicode の非常に多くの部分をカバーしています。 unifont.hex.gz と hex2bdf を <htmlurl url="http://czyborra.com/unifont/" name="http://czyborra.com/unifont/"> からダウンロードしてください。また、これは固定幅ではありません: ヨーロッパの文字は 8 ピクセル幅、中国語などの文字は 16 ピクセルです。次のようにして、インストールを行ないます。 <tscreen><verb> $ gunzip unifont.hex.gz $ hex2bdf < unifont.hex > unifont.bdf $ bdftopcf -o unifont.pcf unifont.bdf $ gzip -9 unifont.pcf # cp unifont.pcf.gz /usr/X11R6/lib/X11/fonts/misc # cd /usr/X11R6/lib/X11/fonts/misc # mkfontdir # xset fp rehash </verb></tscreen> <item> <!-- Primoz Peterlin has assembled an ETL family fonts covering Latin, Greek, Cyrillic, Armenian, Georgian, Hebrew scripts. <htmlurl url="ftp://ftp.x.org/contrib/fonts/etl-unicode.tar.gz" name="ftp://ftp.x.org/contrib/fonts/etl-unicode.tar.gz"> Use the "bdftopcf" program in order to install it. --> Primoz Peterlin は ETL ファミリーのフォントを作りました。これはラテン語、 ギリシャ語、キリル文字、アルメニア語、グルジア語、 ヘブライ語をカバーしています。<newline> <htmlurl url="ftp://ftp.x.org/contrib/fonts/etl-unicode.tar.gz" name="ftp://ftp.x.org/contrib/fonts/etl-unicode.tar.gz"><newline> インストールするには "bdftopcf" プログラムを使用します。 </itemize> <sect1>Unicode xterm <p> <!-- xterm is part of X11R6 and XFree86, but is maintained separately by Tom Dickey. <htmlurl url="http://www.clark.net/pub/dickey/xterm/xterm.html" name="http://www.clark.net/pub/dickey/xterm/xterm.html"> Newer versions (patch level 109 and above) contain support for converting keystrokes to UTF-8 before sending them to the application running in the xterm, and for displaying Unicode characters that the application outputs as UTF-8 byte sequence. --> xterm は X11R6 と XFree86 の 1 部なのですが、Tom Dickey により別にメンテナンスされています。 <htmlurl url="http://www.clark.net/pub/dickey/xterm/xterm.html" name="http://www.clark.net/pub/dickey/xterm/xterm.html"><newline> 新しい バージョン(パッチレベル 109 以降)は、xterm で動作しているアプリケーションにキーストロークを送る前にキーストロークを UTF-8 にコンバートする機能と、アプリケーションの出力する Unicode 文字を UTF-8 のバイトシーケンスとして表示する機能をサポートしています。 <!-- To get an UTF-8 xterm running, you need to: --> UTF-8 をサポートする xterm を実行するには、次のようにします。 <itemize> <!-- Fetch <htmlurl url="http://www.clark.net/pub/dickey/xterm/xterm.tar.gz" name="http://www.clark.net/pub/dickey/xterm/xterm.tar.gz">, --> <htmlurl url="http://www.clark.net/pub/dickey/xterm/xterm.tar.gz" name="http://www.clark.net/pub/dickey/xterm/xterm.tar.gz"> を入手 <item> <!-- Configure it by calling "./configure −−enable-wide-chars ...", then compile and install it. --> "./configure --enable-wide-chars ..." を実行して設定を行ない、コンパイルおよびインストールを行なう <item> <!-- Have a Unicode fixed-width font installed. Markus Kuhn's ucs-fonts.tar.gz (see above) is made for this. --> Unicode 固定幅フォントをインストールする。Markus Kuhn の ucs-fonts.tar.gz(上記を参照)はこのために使えるでしょう。 <item> <!-- Start "xterm -u8 -fn fixed". The option "-u8" turns on Unicode and UTF-8 handling. The "fixed" font is Markus Kuhn's Unicode font. --> "xterm -u8 -fn fixed" を実行します。"-u8" オプションは Unicode と UTF-8 のハンドリング機能を有効にします。"fixed" で指定するフォントは Markus Kuhn の Unicode フォントです。 <item> <!-- Take a look at the sample files contained in Markus Kuhn's ucs-fonts package: --> Markus Kuhn の ucs-fonts パッケージに含まれるサンプルファイルを 覗いてみると、ギリシャ語やロシア語などの文字が見えるはずです。 <tscreen><verb> $ cd .../ucs-fonts $ cat quickbrown.txt $ cat utf-8-demo.txt </verb></tscreen> <!-- You should be seeing (among others) greek and russian characters. --> <item> <!-- To make xterm come up with UTF-8 handling each time it is started, add the line XTerm*utf8: 1 to your $HOME/.Xdefaults (for yourself only). I don't recommend changing the system-wide /usr/X11R6/lib/X11/app-defaults/XTerm, because then your changes will be erased next time you upgrade to a new XFree86 version. --> xterm の起動時から UTF-8 をハンドリングする機能を有効にするには、 XTerm*utf8: 1 という行を $HOME/.Xdefaults に追加します(自分自身の設定だ けを変える場合)。システム全体の設定である /usr/X11R6/lib/X11/app-defaults/XTerm を変更することはお勧めしません。 XFree86 の新しいバージョンにアップグレードした際に、変更が消されてしまう からです。 (訳注:個人的には逆にアップグレードまでは大丈夫なので、 システムワイドな設定の方を好みます) <item> <!-- If you also changed the font name, you need a line of the form <tscreen><verb> *VT100*font: your-font </verb></tscreen> in your $HOME/.Xdefaults. For "fixed" it is not needed, because "fixed" is the default anyway. --> フォントも変更するのであれば、 <tscreen><verb> *VT100*font: フォント名 </verb></tscreen> のような行が $HOME/.Xdefaults に必要となります。 "fixed" の場合には指定する必要はありません。 </itemize> <!-- A further patch which implements support for double-wide characters (mostly CJK ideographs) and combining characters, by Robert Brady <htmlurl url="mailto:rwb197@ecs.soton.ac.uk" name="<rwb197@ecs.soton.ac.uk>">, is available from <htmlurl url="http://www.ecs.soton.ac.uk/~rwb197/xterm/" name="http://www.ecs.soton.ac.uk/~rwb197/xterm/">. --> Robert Brady <htmlurl url="mailto:rwb197@ecs.soton.ac.uk" name="<rwb197@ecs.soton.ac.uk>">, による、倍のサイズのワイド文字 (CJK の表意文字など)の実装、結合(combine)をするためのパッチは<htmlurl url="http://www.ecs.soton.ac.uk/~rwb197/xterm/" name="http://www.ecs.soton.ac.uk/~rwb197/xterm/"> です。 <!-- It is based on xterm patch level 120 <htmlurl url="http://www.clark.net/pub/dickey/xterm/xterm-120.tgz" name="http://www.clark.net/pub/dickey/xterm/xterm-120.tgz"> and is best used with the following settings: --> これは xterm パッチレベル 120 <htmlurl url="http://www.clark.net/pub/dickey/xterm/xterm-120.tgz" name="http://www.clark.net/pub/dickey/xterm/xterm-120.tgz"> ベースです。 次のような設定で使うのがよいでしょう。 <tscreen><verb> *VT100*font: -Misc-Fixed-Medium-R-Normal--18-120-100-100-C-90-ISO10646-1 *VT100*wideFont: -Daewoo-Gothic-Medium-R-Normal--18-18-100-100-M-180-ISO10646-1 </verb></tscreen> <sect1> <!-- Miscellaneous --> その他 <p> <!-- A small program which tests whether a Linux console or xterm is in UTF-8 mode can be found in the <htmlurl url="ftp://sunsite.unc.edu/pub/Linux/system/keyboards/x-lt-1.18.tar.gz" name="ftp://sunsite.unc.edu/pub/Linux/system/keyboards/x-lt-1.18.tar.gz"> package by Ricardas Cepas, files testUTF-8.c and testUTF8.c. --> Linux のコンソールや xterm が UTF-8 モードかどうかをテストする 簡単なプログラム testUTF-8.c と testUTF8.c が、Ricardas Cepas のパッケージ <htmlurl url="ftp://sunsite.unc.edu/pub/Linux/system/keyboards/x-lt-1.18.tar.gz" name="ftp://sunsite.unc.edu/pub/Linux/system/keyboards/x-lt-1.18.tar.gz"> にあります。 <sect> <!-- Locale setup --> ロケール設定 <p> <sect1> <!-- Files & the kernel --> ファイルとカーネル <p> <!-- You can now already use any Unicode characters in file names. No kernel or file utilities need modifications. This is because file names in the kernel can be anything not containing a null byte, and '/' is used to delimit subdirectories. When encoded using UTF-8, non-ASCII characters will never be encoded using null bytes or slashes. All that happens is that file and directory names occupy more bytes than they contain characters. For example, a filename consisting of five greek characters will appear to the kernel as a 10-byte filename. The kernel does not know (and does not need to know) that these bytes are displayed as greek. --> すでに、どのような Unicode 文字でもファイル名として使えるようになってい ます。カーネルやファイルユーティリティの修正は必要ありません。カーネル内 でのファイル名はヌル文字や / を含まない限り何でもかまいません(/ はサブディ レクトリの区切りに使われているからです)。UTF-8 を使用してエンコードされ る時に、非 ASCII 文字がヌル文字や / にエンコードされることはありません。 ファイルやディレクトリの名前が文字数よりも多くのバイト数を占めるだけです。 例えば 5 つのギリシャ文字からなるファイル名はカーネルからは 10 バイトの ファイル名として見えます。カーネルはこれらがギリシャ文字で表示されるとい うことを知りませんし、知る必要もありません。 <!-- This is the general theory, as long as your files stay inside Linux. On filesystems which are used from other operating systems, you have mount options to control conversion of filenames to/from UTF-8: --> これが基本原理です。ファイルが Linux だけで使われるのであれば。他の OS から使用されるファイルシステムのためには、ファイル名を UTF-8 と相互にコ ンバートするマウントオプションがあります。 <itemize> <item> <!-- The "vfat" filesystems has a mount option "utf8". See <htmlurl url="file:/usr/src/linux/Documentation/filesystems/vfat.txt" name="file:/usr/src/linux/Documentation/filesystems/vfat.txt">. When you give an "iocharset" mount option different from the default (which is "iso8859-1"), the results with and without "utf8" are not consistent. Therefore I don't recommend the "iocharset" mount option. --> "vfat" ファイルシステムにはマウントオプション "utf8" があります。 <htmlurl url="file:/usr/src/linux/Documentation/filesystems/vfat.txt" name="file:/usr/src/linux/Documentation/filesystems/vfat.txt"> を見てく ださい。デフォルト("iso8859-1" です)ではなく "iocharset" マウントオプショ ンを指定した場合には "utf8"を使用するどうかに関わらず、結果には一貫性が ありません。ですから "iocharset" マウントオプションはお勧めしません。 <item> <!-- The "msdos", "umsdos" filesystems have the same mount option, but it appears to have no effect. --> "msdos"、"umsdos" ファイルシステムも同じマウントオプションを持っています が、何も起こらないようです。 <item> <!-- The "iso9660" filesystem has a mount option "utf8". See <htmlurl url="file:/usr/src/linux/Documentation/filesystems/isofs.txt" name="file:/usr/src/linux/Documentation/filesystems/isofs.txt">. --> "iso9660" ファイルシステムにはマウントオプション "utf8" があります。 <htmlurl url="file:/usr/src/linux/Documentation/filesystems/isofs.txt" name="file:/usr/src/linux/Documentation/filesystems/isofs.txt"> を見てく ださい。 <item> <!-- Since Linux 2.2.x kernels, the "ntfs" filesystem has a mount option "utf8". See <htmlurl url="file:/usr/src/linux/Documentation/filesystems/ntfs.txt" name="file:/usr/src/linux/Documentation/filesystems/ntfs.txt">. --> Linux 2.2.x カーネル以降は、"ntfs" ファイルシステムにマウントオプション "utf8" があります。<htmlurl url="file:/usr/src/linux/Documentation/filesystems/ntfs.txt" name="file:/usr/src/linux/Documentation/filesystems/ntfs.txt"> を見てください。 </itemize> <!-- The other filesystems (nfs, smbfs, ncpfs, hpfs, etc.) don't convert filenames; therefore they support Unicode file names in UTF-8 encoding only if the other operating system supports them. Recall that to enable a mount option for all future remount, you add it to the fourth column of the corresponding /etc/fstab line. --> 他のファイルシステム(nfs, smbfs, ncpfs, hpfs など)ではファイル名をコンバー トしません。つまりそれらの OS がサポートしている時に限り、UTF-8 でエンコー ディングされた Unicode のファイル名をサポートします。あとで再マウントす る時にマウントオプションを有効にするために /etc/fstab の関係する行の 4 番目のカラムにオプションを追加するとよいでしょう。 <!-- Recall 以降は意訳だけど、こっちの方がよさげ :-) --> <sect1> <!-- Ttys & the kernel --> tty とカーネル <p> <!-- Ttys are some kind of bidirectional pipes between two program, allowing fancy features like echoing or command-line editing. When in an xterm, you execute the "cat" command without arguments, you can enter and edit any number of lines, and they will be echoed back line by line. The kernel's editing actions are not correct, especially the Backspace (erase) key and the tab bey are not treated correctly. --> tty は 2 つのプログラム間にあるいわゆる双方向パイプのような物で、文字の エコーやコマンドラインでの編集といった素敵な機能を持っています。xterm で 引数なしの "cat" コマンドを実行すると何行でも入力や編集ができ、また各行 はエコーバック(訳注:入力した文字のエコー表示)されます。カーネルの編集機 能は正常に動作しません。特に、バックスペースキーとタブキーは正しく扱われ ません。 <!-- To fix this, you need to: --> この問題を修正するには、次のようにします。 <itemize> <item> <!-- apply the kernel patch <htmlurl url="ftp://ftp.ilog.fr/pub/Users/haible/utf8/linux-2.0.35-tty.diff" name="linux-2.0.35-tty.diff"> or <htmlurl url="ftp://ftp.ilog.fr/pub/Users/haible/utf8/linux-2.2.9-tty.diff" name="linux-2.2.9-tty.diff"> or <htmlurl url="ftp://ftp.ilog.fr/pub/Users/haible/utf8/linux-2.3.12-tty.diff" name="linux-2.3.12-tty.diff"> and recompile your kernel, --> 次のうち対応するカーネルパッチをあて、カーネルの再コンパイルをします。<newline> <htmlurl url="ftp://ftp.ilog.fr/pub/Users/haible/utf8/linux-2.0.35-tty.diff" name="linux-2.0.35-tty.diff">, <htmlurl url="ftp://ftp.ilog.fr/pub/Users/haible/utf8/linux-2.2.9-tty.diff" name="linux-2.2.9-tty.diff">, <htmlurl url="ftp://ftp.ilog.fr/pub/Users/haible/utf8/linux-2.3.12-tty.diff" name="linux-2.3.12-tty.diff"> <item> <!-- if you are using glibc2, apply the patch <htmlurl url="ftp://ftp.ilog.fr/pub/Users/haible/utf8/glibc211-tty.diff" name="glibc211-tty.diff"> and recompile your libc (or if you are not so adventurous, it is sufficient to patch an already installed include file: <htmlurl url="ftp://ftp.ilog.fr/pub/Users/haible/utf8/glibc-tty.diff" name="glibc-tty.diff">), --> glibc2 を使っているのであれば、パッチ <htmlurl url="ftp://ftp.ilog.fr/pub/Users/haible/utf8/glibc211-tty.diff" name="glibc211-tty.diff"> をあてて libc の再コンパイルを行います。冒険が好き でなければ、既にインストールされているインクルードファイルにパッチ <htmlurl url="ftp://ftp.ilog.fr/pub/Users/haible/utf8/glibc-tty.diff" name="glibc-tty.diff"> をあてるだけで充分です。 <item> <!-- apply the patch <htmlurl url="ftp://ftp.ilog.fr/pub/Users/haible/utf8/stty.diff" name="stty.diff"> to GNU sh-utils-1.16b, and rebuild the "stty" program, then test it using "stty -a" and "stty iutf8". --> パッチ <htmlurl url="ftp://ftp.ilog.fr/pub/Users/haible/utf8/stty.diff" name="stty.diff">を GNU sh-utils-1.16b にあてて "stty" プログラムの リビルドを行ない、"stty -a" と "stty iutf8" を使ってテストをします。 <item> <!-- add the command "stty iutf8" to the "unicode_start" script, and add the command "stty -iutf8" to the "unicode_stop script. --> "stty iutf8" コマンドを "unicode_start" スクリプトに、 "stty -iutf8" コマンドを "unicode_stop" スクリプトに追加します。 <item> <!-- apply the patch <htmlurl url="ftp://ftp.ilog.fr/pub/Users/haible/utf8/xterm.diff" name="xterm.diff"> to xterm-109, and rebuild "xterm", then test it by starting "xterm -u8"/"xterm +u8" and running "stty -a" and interactive "cat" inside it. --> パッチ <htmlurl url="ftp://ftp.ilog.fr/pub/Users/haible/utf8/xterm.diff" name="xterm.diff"> を xterm-109 にあてて "xterm" のリビルドを行い、 "xterm - u8" や "xterm +u8" を実行して、そこで "stty -a" や "cat" を動か してテストします。 </itemize> <!-- To make this fix persistent across rlogin and telnet, you also need to: --> rlogin や telnet をしてもこの修正を有効にし続けるには次のことを する必要があります: <itemize> <item> <!-- Define new values for the TERM environment variable, "linux-utf8" as an alias to "linux", and "xterm-utf8" as an alias to "xterm". If your system has the ncurses library and the /usr/lib/terminfo (or /usr/share/terminfo) database, do this by running --> 環境変数 TERM に新しい値("linux" へのエイリアスとして "linux-utf8" を、 "xterm" へのエイリアスとして "xterm-utf8")を定義します。システムに ncurses ライブラリと /usr/lib/terminfo(または /usr/share/terminfo) があ る場合には、 <tscreen><verb> $ tic linux-utf8.terminfo $ tic xterm-utf8.terminfo </verb></tscreen> <!-- as non-root (this will create the terminfo entries in your $HOME/.terminfo directory). Here are <htmlurl url="ftp://ftp.ilog.fr/pub/Users/haible/utf8/linux-utf8.terminfo" name="linux-utf8.terminfo"> and <htmlurl url="ftp://ftp.ilog.fr/pub/Users/haible/utf8/xterm-utf8.terminfo" name="xterm-utf8.terminfo">. I don't recommend running this as root, because it will create the terminfo entries in /usr/lib/terminfo where they might be erased next time you upgrade your system. If your system has an /etc/termcap file, you should also edit that file: copy the linux and xterm entries and give them the new names "linux-utf8" and "xterm-utf8". For an example, see <htmlurl url="ftp://ftp.ilog.fr/pub/Users/haible/utf8/termcap.diff" name="termcap.diff">. --> を root 以外で実行することによって行います。これは terminfo エントリを $HOME/.terminfo ディレクトリに作ります。ここに <htmlurl url="ftp://ftp.ilog.fr/pub/Users/haible/utf8/linux-utf8.terminfo" name="linux-utf8.terminfo"> と <htmlurl url="ftp://ftp.ilog.fr/pub/Users/haible/utf8/xterm-utf8.terminfo" name="xterm-utf8.terminfo"> があります。この作業を root で行うこと はお勧めしません。実行すると /usr/lib/terminfo に terminfo エントリを作 成してしまいますが、これはシステムをアップグレードした時に消されてしまう かもしれません。システムに /etc/termcap ファイルがある場合には、そのファ イルも編集した方がよいでしょう。linux と xterm エントリをコピーし、それ ぞれに新しい名前 "linux-utf8" と "xterm-utf8" を付けます。例はこの <htmlurl url="ftp://ftp.ilog.fr/pub/Users/haible/utf8/termcap.diff" name="termcap.diff"> です。 <item> <!-- Each time you call "unicode_start" or "unicode_stop" from the console, also execute "export TERM=linux-utf8" or "export TERM=linux", respectively. --> コンソールから "unicode_start" や "unicode_stop" を呼びだす度に、それ ぞれ "export TERM=linux-utf8" や "export TERM=linux" も実行してください。 <item> <!-- Apply the patch <htmlurl url="ftp://ftp.ilog.fr/pub/Users/haible/utf8/xterm2.diff" name="xterm2.diff"> to xterm-109, rebuild "xterm", and remove any "XTerm*termName" line from /usr/X11R6/lib/X11/app-defaults/XTerm and $HOME/.Xdefaults. Now xterm sets the TERM variable to "xterm-utf8" instead of "xterm" when running in UTF-8 mode. --> パッチ <htmlurl url="ftp://ftp.ilog.fr/pub/Users/haible/utf8/xterm2.diff" name="xterm2.diff">を xterm-109 にあてて "xterm" をリビルドし、 /usr/X11R6/lib/X11/app-defaults/XTerm と $HOME/.Xdefaults から全ての "XTerm*termName" 行を取り除きます。これで xterm が UTF-8 モードで実行さ れている時の TERM 変数は "xterm" の代わりに "xterm-utf8" となっています。 <item> <!-- Apply the patches <htmlurl url="ftp://ftp.ilog.fr/pub/Users/haible/utf8/netkit.diff" name="netkit.diff">, <htmlurl url="ftp://ftp.ilog.fr/pub/Users/haible/utf8/netkitb.diff" name="netkitb.diff"> and <htmlurl url="ftp://ftp.ilog.fr/pub/Users/haible/utf8/telnet.diff" name="telnet.diff"> and rebuild "rlogind" and "telnetd". Now rlogin and telnet put the tty into UTF-8 editing mode whenever the TERM environment variable is "linux-utf8" or "xterm-utf8". --> パッチ <htmlurl url="ftp://ftp.ilog.fr/pub/Users/haible/utf8/netkit.diff" name="netkit.diff">, <htmlurl url="ftp://ftp.ilog.fr/pub/Users/haible/utf8/netkitb.diff" name="netkitb.diff">, <htmlurl url="ftp://ftp.ilog.fr/pub/Users/haible/utf8/telnet.diff" name="telnet.diff"> をあてて "rlogind" と "telnetd" をリビルドします。こ れで rlogin と telnet は TERM 変数が "linux-utf8" や "xterm-utf8" である 時には、いつでも tty を UTF-8 編集モードにすることができます。 </itemize> <sect1> <!-- General data conversion --> 一般的なデータ変換 <p> <!-- You will need a program to convert your locally (probably ISO-8859-1) encoded texts to UTF-8. (The alternative would be to keep using texts in different encodings on the same machine; this is not fun in the long run.) One such program is `iconv', which comes with glibc-2.1. Simply use --> ローカルでのエンコーディング(おそらく ISO-88591 や EUC)がされているテキ ストを UTF-8 にコンバートするプログラムが必要になるはずです。(代替としては 同じマシン上で、それぞれ異なったエンコーディングのテキストを使い続けるこ とですが、これは長期的に見るとあまり楽しいことではありません) そのよ うなプログラムの 1 つに `iconv' があります。これは glibc-2.1 に同梱され ており、次のようにして簡単に使えます。 <tscreen><verb> $ iconv --from-code=ISO-8859-1 --to-code=UTF-8 < old_file > new_file </verb></tscreen> <!-- Here are two handy shell scripts, called "i2u" <htmlurl url="ftp://ftp.ilog.fr/pub/Users/haible/utf8/i2u.sh" name="i2u.sh"> (for ISO to UTF conversion) and "u2i" <htmlurl url="ftp://ftp.ilog.fr/pub/Users/haible/utf8/u2i.sh" name="u2i.sh"> (for UTF to ISO conversion). Adapt according to your current 8-bit character set. --> この <htmlurl url="ftp://ftp.ilog.fr/pub/Users/haible/utf8/i2u.sh" name="i2u.sh"> (ISO を UTF にコンバート) と <htmlurl url="ftp://ftp.ilog.fr/pub/Users/haible/utf8/u2i.sh" name="u2i.sh"> (UTF を ISO にコンバート)は、便利なスクリプトです。いま利用している 8 ビット 文字セットに合うように修正してください。 <!-- If you don't have glibc-2.1 and iconv installed, you can use GNU recode 3.5 instead. "i2u" <htmlurl url="ftp://ftp.ilog.fr/pub/Users/haible/utf8/i2u_recode.sh" name="i2u_recode.sh"> is "recode ISO-8859-1..UTF-8", and "u2i" <htmlurl url="ftp://ftp.ilog.fr/pub/Users/haible/utf8/u2i_recode.sh" name="u2i_recode.sh"> is "recode UTF-8..ISO-8859-1". <htmlurl url="ftp://ftp.iro.umontreal.ca/pub/recode/recode-3.5.tar.gz" name="ftp://ftp.iro.umontreal.ca/pub/recode/recode-3.5.tar.gz"> <htmlurl url="ftp://ftp.gnu.org/pub/gnu/recode/recode-3.5.tar.gz" name="ftp://ftp.gnu.org/pub/gnu/recode/recode-3.5.tar.gz"> Notes: You need GNU recode 3.5 or newer. To compile GNU recode 3.5 on platforms without glibc2 (i.e. on all platforms except recent Linux systems), you need to configure it with −−disable-nls, otherwise it won't link. Newer development versions of GNU recode with CJK support are available at <htmlurl url="http://www.iro.umontreal.ca/contrib/recode/" name="http://www.iro.umontreal.ca/contrib/recode/">. --> glibc-2.1 や iconv がインストールされていなければ、GNU recode 3.5 を代わ りに使用することができます。"i2u" <htmlurl url="ftp://ftp.ilog.fr/pub/Users/haible/utf8/i2u_recode.sh" name="i2u_recode.sh"> は"recode ISO-8859-1..UTF-8" と、"u2i" <htmlurl url="ftp://ftp.ilog.fr/pub/Users/haible/utf8/u2i_recode.sh" name="u2i_recode.sh"> は "recode UTF-8..ISO-8859-1" として行います。 <htmlurl url="ftp://ftp.iro.umontreal.ca/pub/recode/recode-3.5.tar.gz" name="ftp://ftp.iro.umontreal.ca/pub/recode/recode-3.5.tar.gz"> <htmlurl url="ftp://ftp.gnu.org/pub/gnu/recode/recode-3.5.tar.gz" name="ftp://ftp.gnu.org/pub/gnu/recode/recode-3.5.tar.gz">注意: GNU recode 3.5 以上が必要となります。GNU recode 3.5 のコンパイルを glibc2 が 存在しないプラットフォーム(つまり古い Linux システム)で行なうには、-- disable-nls を指定して configure する必要があります。指定しない場合には リンクに失敗します。 CJK をサポートする開発版の新しい GNU recode はここから入手できます。 <htmlurl url="http://www.iro.umontreal.ca/contrib/recode/" name="http://www.iro.umontreal.ca/contrib/recode/"> <!-- Or you can also use CLISP instead. Here are "i2u" <htmlurl url="ftp://ftp.ilog.fr/pub/Users/haible/utf8/i2u.lsp" name="i2u.lsp"> and "u2i" <htmlurl url="ftp://ftp.ilog.fr/pub/Users/haible/utf8/u2i.lsp" name="u2i.lsp"> written in Lisp. Note: You need a CLISP version from July 1999 or newer. <htmlurl url="ftp://clisp.cons.org/pub/lisp/clisp/source/clispsrc.tar.gz" name="ftp://clisp.cons.org/pub/lisp/clisp/source/clispsrc.tar.gz">. --> CLISP を代わりに使用することもできます。この "i2u" <htmlurl url="ftp://ftp.ilog.fr/pub/Users/haible/utf8/i2u.lsp" name="i2u.lsp"> と "u2i" <htmlurl url="ftp://ftp.ilog.fr/pub/Users/haible/utf8/u2i.lsp" name="u2i.lsp"> は Lisp で書かれています。注意: CLISP の 1999 年 7 月以 降のバージョンが必要です。<htmlurl url="ftp://clisp.cons.org/pub/lisp/clisp/source/clispsrc.tar.gz" name="ftp://clisp.cons.org/pub/lisp/clisp/source/clispsrc.tar.gz"> <!-- Other data conversion programs, less powerful than GNU recode, are `trans' <htmlurl url="ftp://ftp.informatik.uni-erlangen.de/pub/doc/ISO/charsets/trans113.tar.gz" name="ftp://ftp.informatik.uni-erlangen.de/pub/doc/ISO/charsets/trans113.tar.gz">, `tcs' from the Plan9 operating system <htmlurl url="ftp://ftp.informatik.uni-erlangen.de/pub/doc/ISO/charsets/tcs.tar.gz" name="ftp://ftp.informatik.uni-erlangen.de/pub/doc/ISO/charsets/tcs.tar.gz">, and `utrans'/`uhtrans'/`hutrans' <htmlurl url="ftp://ftp.cdrom.com/pub/FreeBSD/distfiles/i18ntools-1.0.tar.gz" name="ftp://ftp.cdrom.com/pub/FreeBSD/distfiles/i18ntools-1.0.tar.gz"> by G. Adam Stanislav <htmlurl url="mailto:adam@whizkidtech.net" name="<adam@whizkidtech.net>">. --> GNU record よりも機能が劣りますが、その他のデータコンバートプログラムには `trans' <htmlurl url="ftp://ftp.informatik.uni-erlangen.de/pub/doc/ISO/charsets/trans113.tar.gz" name="ftp://ftp.informatik.uni-erlangen.de/pub/doc/ISO/charsets/trans113.tar.gz">、 Plan9 operating system の `tcs' <htmlurl url="ftp://ftp.informatik.uni-erlangen.de/pub/doc/ISO/charsets/tcs.tar.gz" name="ftp://ftp.informatik.uni-erlangen.de/pub/doc/ISO/charsets/tcs.tar.gz">、 G. Adam Stanislav の作成した `utrans'/`uhtrans'/`hutrans' <htmlurl url="ftp://ftp.cdrom.com/pub/FreeBSD/distfiles/i18ntools-1.0.tar.gz" name="ftp://ftp.cdrom.com/pub/FreeBSD/distfiles/i18ntools-1.0.tar.gz"> <htmlurl url="mailto:adam@whizkidtech.net" name="<adam@whizkidtech.net>"> があります。 <!-- For the repeated conversion of files to UTF-8 from different character sets, a semi-automatic tool can be used: <htmlurl url="ftp://ftp.ilog.fr/pub/Users/haible/utf8/to-utf8" name="to-utf8"> presents the non-ASCII parts of a file to the user, lets him decide about the file's original character set, and then converts the file to UTF-8. --> 他の文字セットから UTF-8 へのファイルのコンバートをたびたび行なう時には 半自動のツール <htmlurl url="ftp://ftp.ilog.fr/pub/Users/haible/utf8/to-utf8" name="to-utf8"> を 使うことができます。これはファイルの非 ASCII 文字をユーザーに表示し、ファ イルの元の文字セットをユーザーに選択させることによりファイルを UTF-8 にコンバー トすることができます。 <sect1> <!-- Locale environment variables --> ロケールの環境変数 <p> <!-- You may have the following environment variables set, containing locale names: --> 次の環境変数にロケール名などをセットすることができます。 <descrip> <tag>LANGUAGE</tag> <!-- override for LC_MESSAGES, used by GNU gettext only --> LC_MESSAGES (の設定)を上書きします。GNU gettext だけが使用します。 <tag>LC_ALL</tag> <!-- override for all other LC_* variables --> 他の LC_* 変数で指定されている全ての設定を上書き(他の設定より この指定が優先)します。 <tag>LC_CTYPE, LC_MESSAGES, LC_COLLATE, LC_NUMERIC, LC_MONETARY, LC_TIME</tag> <!-- individual variables for: character types and encoding, natural language messages, sorting rules, number formatting, money amount formatting, date and time display --> それぞれ、次の内容を設定する変数です: 文字の種類とエンコーディング、 メッセージ表示に使用する言語、 ソートのルール、 数字の書式、 通貨の書式、 日付と時間の表示 <tag>LANG</tag> <!-- default value for all LC_* variables --> 全ての LC_* 変数のデフォルト値です。 LC_* を指定しない場合には、LANG の値が適用されます。 </descrip> <!-- (See `<tt>man 7 locale</tt>' for a detailed description.) --> (詳細は `<tt>man 7 locale</tt>' を参照してください) <!-- Each of the LC_* and LANG variables can contain a locale name of the following form: --> それぞれの LC_* と LANG 変数には、次のような形でロケール名を指定することができます。 <quote> language[_territory[.codeset]][@modifier] </quote> <!-- where language is an <htmlurl url="ftp://ftp.ilog.fr/pub/Users/haible/utf8/ISO_639.html" name="ISO 639"> language code (lower case), territory is an <htmlurl url="ftp://ftp.ilog.fr/pub/Users/haible/utf8/ISO_3166.html" name="ISO 3166"> country code (upper case), codeset denotes a character set, and modifier stands for other particular attributes (for example indicating a particular language dialect, or a nonstandard orthography). --> ここで language は <htmlurl url="ftp://ftp.ilog.fr/pub/Users/haible/utf8/ISO_639.html" name="ISO 639"> language code(小文字)、territory は <htmlurl url="ftp://ftp.ilog.fr/pub/Users/haible/utf8/ISO_3166.html" name="ISO 3166"> country code(大文字)、codeset は文字セットを意味し、modifier はその他の 特別な属性(例えば、方言や標準とは違った綴りなど)を表しています。 <!-- LANGUAGE can contain several locale names, separated by colons. --> LANGUAGE には、複数のロケール名をコロンで区切って指定することができます。 <!-- In order to tell your system and all applications that you are using UTF-8, you need to add a codeset suffix of UTF-8 to your locale names. For example, if you were using --> システムやアプリケーションに UTF-8 を使用していると指定するためには、 ロケール名にコードセットのサフィックスとして UTF-8 を追加する必要があります。例えば、 <tscreen><verb> LANGUAGE=de:fr:en LC_CTYPE=de_DE </verb></tscreen> <!-- you would change this to --> を使用しているのであれば、このように変更します。 <tscreen><verb> LANGUAGE=de.UTF-8:fr.UTF-8:en.UTF-8 LC_CTYPE=de_DE.UTF-8 </verb></tscreen> <sect1> <!-- Creating the locale support files --> ロケールサポートファイルの作成 <p> <!-- If you have glibc-2.1 or glibc-2.1.1 or glibc-2.1.2 installed, first check using "localedef −−help" that the system directory for character maps is /usr/share/i18n/charmaps. Then apply to the file /usr/share/i18n/charmaps/UTF8 the patch <htmlurl url="ftp://ftp.ilog.fr/pub/Users/haible/utf8/glibc21.diff" name="glibc21.diff"> or <htmlurl url="ftp://ftp.ilog.fr/pub/Users/haible/utf8/glibc211.diff" name="glibc211.diff"> or <htmlurl url="ftp://ftp.ilog.fr/pub/Users/haible/utf8/glibc212.diff" name="glibc212.diff">, respectively. Then create the support files for each UTF-8 locale you intend to use, for example: --> glibc-2.1、glibc-2.1.1、glibc-2.1.2 のどれかをインストールしている場合に は、まず "localedef --help" を使用して、文字マップのシステムディレ クトリが /usr/share/i18n/charmaps かどうかをチェックします。次に /usr/share/i18n/charmaps/UTF8 ファイルに <htmlurl url="ftp://ftp.ilog.fr/pub/Users/haible/utf8/glibc21.diff" name="glibc21.diff">, <htmlurl url="ftp://ftp.ilog.fr/pub/Users/haible/utf8/glibc211.diff" name="glibc211.diff">, <htmlurl url="ftp://ftp.ilog.fr/pub/Users/haible/utf8/glibc212.diff" name="glibc212.diff"> の対応するパッチをあてます。そして、例えばこのよう にして利用する UTF-8 ロケール用のサポートファイルを作成します。 <tscreen><verb> $ localedef -v -c -i de_DE -f UTF8 /usr/share/locale/de_DE.UTF-8 </verb></tscreen> <!-- You typically don't need to create locales named "de" or "fr" without country suffix, because these locales are normally only used by the LANGUAGE variable and not by the LC_* variables, and LANGUAGE is only used as an override for LC_MESSAGES. --> 通常は country サフィックスなしの "de" や "fr" といったロケールを作成 する必要はありません。これらのロケールは大抵の場合には LANGUAGE 変数から 使われるだけで、LC_* 変数には使われないからです。また、LANGUAGE が使われ るのは LC_MESSAGES の設定を上書きする場合だけです。 <sect1> <!-- Adding support to the C library --> C ライブラリにサポートを追加する <p> <!-- The glibc-2.2 will support multibyte locales, in particular the UTF-8 locales created above. But glibc-2.1 or glibc-2.1.1 do not really support it. Therefore the only real effect of the above creation of the /usr/share/locale/de_DE.UTF-8/* files is that `setlocale(LC_ALL,"")' will return "de_DE.UTF-8", according to your environment variables, instead of stripping off the ".UTF-8" suffix. --> glibc-2.2 はマルチバイトのロケール、特に上記で作成された UTF-8 ロケール をサポートします。ですが glibc-2.1 や glibc-2.1.1 は実際にはマルチバイト をサポートしません。つまり上記で作成した /usr/share/locale/de_DE.UTF-8/* ファイルの実際の効果は、`setlocale(LC_ALL,"")' が環境変数の設定により ".UTF-8" サフィックスを取り除かずに "de_DE.UTF-8" を返すだけです。 <!-- To add support for the UTF-8 locale, you should build and install the `libutf8_plug.so' library, from <htmlurl url="ftp://ftp.ilog.fr/pub/Users/haible/utf8/libutf8-0.6.2.tar.gz" name="libutf8-0.6.2.tar.gz">. Then you can set the LD_PRELOAD environment variable to point to the installed library: --> UTF-8 ロケールのサポートを追加するには `libutf8_plug.so' ライブラリ <htmlurl url="ftp://ftp.ilog.fr/pub/Users/haible/utf8/libutf8-0.6.2.tar.gz" name="libutf8-0.6.2.tar.gz"> をビルドして、インストールします。 そしてインストールされたライブラリを指すように LD_PRELOAD 環境変数をセットします。 <tscreen><verb> $ export LD_PRELOAD=/usr/local/lib/libutf8_plug.so </verb></tscreen> <!-- Then, in every program launched with this environment variable set, the functions in libutf8_plug.so will override the original ones in /lib/libc.so.6. For more info about LD_PRELOAD, see "man 8 ld.so". --> これで、この環境変数がセットされて起動された全てのアプリケーションで libutf8_plug.so の関数が /lib/libc.so.6 のオリジナルのものより優先されます。 LD_PRELOAD に関する詳細は "man 8 ld.so" を参照してください。 <!-- This entire thing will not be necessary any more once glibc-2.2 comes out. --> ここで述べた全てのことは、glibc-2.2 が出ればもはや必要なくなります。 <sect1> <!-- Converting the message catalogs --> メッセージカタログのコンバート <p> <!-- Now let's fill these new locales with content. The following /bin/sh commands can convert your message catalogs to UTF-8 format. They must be run as root, and require the programs `msgfmt' and `msgunfmt' from GNU gettext-0.10.35 to be installed. <htmlurl url="ftp://ftp.ilog.fr/pub/Users/haible/utf8/convert-msgcat.sh" name="convert-msgcat.sh"> --> さて新しいロケールの中身を埋めましょう。次の /bin/sh コマンドはメッセー ジカタログを UTF-8 フォーマットにコンバートすることができます。これは root で実行する必要があり、また GNU gettext-0.10.35 の `msgfmt' と `msgunfmt' がインストールされている必要があります。<htmlurl url="convert-msgcat.sh" name="convert-msgcat.sh"> <!-- This too will not be necessary any more once glibc-2.2 comes out, because by then, the gettext function will convert the strings appropriately from the translator's character set to the user's character set, using either iconv or librecode. --> これも glibc-2.2 が出ればもはや必要なくなります。その時までには gettext は iconv や librecode を使用して、文字列を適切に元の文字セットからユーザー の文字セットへコンバートするでしょうから。 <sect> <!-- Specific applications --> アプリケーション固有の情報 <p> <sect1> <!-- Networking --> ネットワーク <p> <sect2>rlogin <p> <!-- is fine with the above mentioned patches. --> は上記で述べたパッチでうまく動作します。 <sect2>telnet <p> <!-- telnet is not 8-bit clean by default. In order to be able to send Unicode keystrokes to the remote host, you need to set telnet into "outbinary" mode. There are two ways to do this: --> デフォルトでは telnet は 8 ビットクリーンではありません。Unicode のキーストロークをリモートのホストへ送るためには、telnet を "outbinary" モードにセットする必要があります。そのためには次の 2 つの方法があります。 <tscreen><verb> $ telnet -L <host> </verb></tscreen> <!-- and --> もしくは <tscreen><verb> $ telnet telnet> set outbinary telnet> open <host> </verb></tscreen> <!-- Additionally, use the above mentioned patches. --> さらに上記で述べたパッチも使用してください。 <sect1> <!-- Browsers --> ブラウザ <p> <sect2>Netscape <p> <!-- Netscape 4.05 or newer can display HTML documents in UTF-8 encoding. All a document needs is the following line between the <head> and </head> tags: --> Netscape 4.05 以降では UTF-8 でエンコードされた HTML 文書を表示すること ができます。そのためには全ての文書で <head> と </head> タグの間にこのよ うな行が必要です。 <tscreen><verb> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> </verb></tscreen> <!-- Netscape 4.05 or newer can also display HTML and text files in UCS-2 encoding with byte-order mark. --> Netscape 4.05 以降では、バイトオーダーのマークが付いた UCS-2 エンコーディング の HTML やテキストファイルも表示できます。 <htmlurl url="http://www.netscape.com/computing/download/" name="http://www.netscape.com/computing/download/"> <sect2>lynx <p> <!-- lynx-2.8 has an options screen (key 'O') which permits to set the display character set. When running in an xterm or Linux console in UTF-8 mode, set this to "UNICODE UTF-8". --> lynx2.8 にはオプション設定用の画面('O' キーを押下)があり、ここで表示する 文字セットを設定することができます。UTF-8 モードの xterm や Linux コンソールで実行している時には、これを "UNICODE UTF-8" にセットします。 <!-- Now, again, all a document needs is the following line between the <head> and </head> tags: --> ここでもう一度。全ての文書には <head> と </head> タグの間に次のような行が必要です。 <tscreen><verb> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> </verb></tscreen> <!-- When you are viewing text files in UTF-8 encoding, you also need to pass the command-line option "-assume_local_charset=UTF-8" (affects only file:/... URLs) or "-assume_charset=UTF-8" (affects all URLs). In lynx-2.8.2 you can alternatively, in the options screen (key 'O'), change the assumed document character set to "utf-8". --> UTF-8 でエンコードされたテキストファイルを見るときには、コマンドラインオ プション "-assume_local_charset=UTF-8"(file:/... の URL だけに影響を及ぼします)、 もしくは "-assume_charset=UTF-8"(全ての URL に影響を及ぼします)も必要と なります。lynx-2.8.2 ではオプション設定画面('O' キーを押下)で "仮定する 文字セット/assumed document character set" を "utf-8" に変更することもで きます。 (訳注: 設定画面のオプション名(日本語・英語共に)は、Kondara MNU/Linux 1.0 に同梱されている lynx 2.8.2-3k1 で確認しました) <!-- There is also an option in the options screen, to set the "preferred document character set". But it has no effect, at least with file:/... URLs and with http://... URLs served by apache-1.3.0. --> オプション設定画面には "使用したい文書のキャラクターセット/preferred document character set" オプションもありますが、少なくとも apache-1.3.0 における file:/... URL と http://... URL では何の効果もありません。 <!-- There is a spacing and line-breaking problem, however. (Look at the russian section of x-utf8.html, or at utf-8-demo.txt.) --> 文字のスペーシングおよびラインブレークには問題があります(x-utf8.html のロシア語のセクションや utf-8-demo.txt を見てみてください)。 <!-- Also, in lynx-2.8.2, configured with −−enable-prettysrc, the nice colour scheme does not work correctly any more when the display character set has been set to "UNICODE UTF-8". This is fixed by a simple patch <htmlurl url="ftp://ftp.ilog.fr/pub/Users/haible/utf8/lynx282.diff" name="lynx282.diff">. --> さらに lynx-2.8.2 では --enable-prettysrc で設定されている場合、表示 文字セットが "UNICODE UTF-8" にセットされているとカラー表示が正常に動作 しません。これは簡単なパッチ <htmlurl url="ftp://ftp.ilog.fr/pub/Users/haible/utf8/lynx282.diff" name="lynx282.diff"> で修正することができます。 <!-- The Lynx developers say: "For any serious use of UTF-8 screen output with lynx, compiling with slang lib and -DSLANG_MBCS_HACK is still recommended." --> Lynx 開発者曰く、「UTF-8 でのスクリーン表示をするために普段 lynx を利用す る場合であっても、slang ライブラリと -DSLANG_MBCS_HACK オプションでコン パイルすることを依然としてお勧めします」です。 <htmlurl url="ftp://ftp.gnu.org/pub/gnu/lynx/lynx-2.8.2.tar.gz" name="ftp://ftp.gnu.org/pub/gnu/lynx/lynx-2.8.2.tar.gz"> <htmlurl url="http://lynx.browser.org/" name="http://lynx.browser.org/"> <htmlurl url="http://www.slcc.edu/lynx/" name="http://www.slcc.edu/lynx/"> <htmlurl url="ftp://lynx.isc.org/" name="ftp://lynx.isc.org/"> <sect2> <!-- Test pages --> テスト用ページ <p> <!-- Some test pages for browsers can be found at the pages of Alan Wood <htmlurl url="http://www.hclrss.demon.co.uk/unicode/#links" name="http://www.hclrss.demon.co.uk/unicode/#links"> and James Kass <htmlurl url="http://home.att.net/~jameskass/" name="http://home.att.net/~jameskass/">. --> ブラウザのためのテストページが、Alan Wood のサイト <htmlurl url="http://www.hclrss.demon.co.uk/unicode/#links" name="http://www.hclrss.demon.co.uk/unicode/#links"> および James Kass のサイト <htmlurl url="http://home.att.net/~jameskass/" name="http://home.att.net/~jameskass/"> にあります。 <sect1> <!-- Editors --> エディタ <p> <sect2>yudit <p> <!-- yudit by Gáspár Sinai <htmlurl url="http://czyborra.com/yudit/" name="http://czyborra.com/yudit/"> is a first-class unicode text editor for the X Window System. It supports simultaneous processing of many languages, input methods, conversions for local character standards. It has facilities for entering text in all languages with only an English keyboard, using keyboard configuration maps. --> Gáspár Sinai の yudit <htmlurl url="http://czyborra.com/yudit/" name="http://czyborra.com/yudit/">は、X Window System 用のすばらしい unicode テキストエディターです。多くの言語 やインプットメソッド、ローカルの文字セットへのコンバートをサポートしてお り、キーボード設定マップを使用することにより、英語キーボードだけで全ての 言語でのテキストの入力を行なうことが可能になります。 <!-- It can be compiled in three versions: Xlib GUI, KDE GUI, or Motif GUI. --> 次の 3 種類のバージョンをコンパイルすることができます: Xlib GUI, KDE GUI, Motif GUI <!-- Customization is very easy. Typically you will first customize your font. From the font menu I chose "Unicode". Then, since the command "xlsfonts '*-*-iso10646-1'" still showed some ambiguity, I chose a font size of 13 (to match Markus Kuhn's 13-pixel fixed font). --> カスタマイズは非常に簡単です。一般的なカスタマイズは、まずフォント からでしょう。フォントメニューから "Unicode" を選び、コマンド "xlsfonts ' *-*-iso10646-1'" ではまだフォントサイズが適当ではないため、(Markus Kuhn の 13 ピクセル固定フォントにマッチさせるため)フォントサイズ 13 を選択し ました。 <!-- Next, you will customize your input method. The input methods "Straight", "Unicode" and "SGML" are most remarkable. For details about the other built-in input methods, look in /usr/local/share/yudit/data/. --> 次にインプットメソッドのカスタマイズを行ないます。インプットメソッドは "Straight", "Unicode", "SGML" がベストの選択でしょう。他のビルトイン・イ ンプットメソッドの詳細は /usr/local/share/yudit/data/ を御覧ください。 <!-- To make a change the default for the next session, edit your $HOME/.yuditrc file. --> 次に実行した時にも変更を有効にするためには、$HOME/.yuditrc ファイルを編集してください。 <!-- The general editor functionality is limited to editing, cut&paste and search&replace. No undo. --> このエディターの基本的な機能は編集、カット & ペースト、 検索および置換だけです。アンドゥはありません。 <sect2>mined98 <p> <!-- mined98 is a small text editor by Michiel Huisjes, Achim Müller and Thomas Wolff. <htmlurl url="http://www.inf.fu-berlin.de/~wolff/mined.html" name="http://www.inf.fu-berlin.de/~wolff/mined.html"> It lets you edit UTF-8 or 8-bit encoded files, in an UTF-8 or 8-bit xterm. It also has powerful capabilities for entering Unicode characters. --> mined98 は Michiel Huisjes, Achim Müller, Thomas Wolff が作った小さ なテキストエディターです。<htmlurl url="http://www.inf.fu-berlin.de/~wolff/mined.html" name="http://www.inf.fu-berlin.de/~wolff/mined.html"> これは UTF-8 ある いは 8 ビット の xterm で、UTF-8 や 8 ビットでエンコードされたファイルの 編集をすることができます。また Unicode 文字の入力のための強力な機能があ ります。 <!-- When it is running in xterm or Linux console in UTF-8 mode, you should set the environment variable <tt>utf8_term</tt>, or call mined with the command-line option <tt>-U</tt>. --> UTF-8 モードの xterm や Linux コンソールで実行している時には、環境変数 <tt>utf8_term</tt> をセットするか、もしくは mined をコマンドライン引数 <tt>-U</tt> で起動する必要があります。 <!-- mined lets you edit both 8-bit encoded and UTF-8 encoded files. By default it uses an autodetection heuristic. If you don't want to rely on heuristics, pass the command-line option <tt>-u</tt> when editing an UTF-8 file, or <tt>+u</tt> when editing an 8-bit encoded file. You can change the interpretation at any time from within the editor: It displays the encoding ("L:h" for 8-bit, "U:h" for UTF-8) in the menu line. Click on the first of these characters to change it. --> mined では 8 ビットや UTF-8 でエンコードされたファイルを編集することがで きます。デフォルトでは発見的自動検出(autodetection heuristic)を行ないま すが、これを使用したくない時は、UTF-8 ファイルを編集する時にはコマンドラ イン引数 <tt>-u</tt> を、8 ビットエンコーディングされたファイルを編集す る時には <tt>+u</tt> を付けて起動します。設定はいつでもエディター内で変 更することができます。エンコーディングはメニュー行に("L:h" は 8 ビットで、 "U:h" は UTF-8)表示されています。変更するにはこの文字の始めをクリックし てください。 <!-- A few caveats: --> 注意点: <itemize> <item> <!-- The Linux binary in the distribution is out of date and does not support UTF-8. You have to rebuild a binary from the source. Then install src/mined as /usr/local/bin/mined, and install doc/mined.help as /usr/local/man/cat1/mined.1, so that <tt>ESC h</tt> will find it. --> ディストリビューションに含まれているバイナリファイルは古く、UTF-8 をサポー トしていません。ソースからバイナリをリビルドする必要があります。それから src/mined を /usr/local/bin/mined として、doc/mined.help を /usr/local/man/cat1/mined.1 としてインストールします。そうすれば <tt>ESC h</tt> コマンドでマニュアルを見付けることができます。 <item> <!-- mined ignores your "stty erase" setting. When your backspace key sends ASCII code 127, and you have set "stty erase ^?", −− these are the ultimately correct settings −− you have to call mined with option <tt>-B</tt> in order to get the backspace key erase a character to the left of the cursor. --> mined は "stty erase" 設定を無視します。バックスペースキーが ASCII コー ド 127 を send し、また "stty erase ^?" を設定している場合には(これらは 正しい設定です)、mined を <tt>-B</tt> 引数で起動する必要があります。これ により、バックスペースキーがカーソルの左の文字を消すようになります。 <item> <!-- The "Home", "End", "Delete" keys do not work. --> "Home", "End", "Delete" キーは動作しません。 </itemize> <sect2>vim <p> <!-- vim (as of version 5.4m) has some support for multi-byte locales, but only as far as the X library has the same support, and only for encodings with at most two bytes per character (i.e. ISO-2022 encodings). No UTF-8 support. --> vim(version 5.4m 以降)はマルチバイトロケールをサポートしますが、X library がこのサポート機能を持っている必要があります。また 1 文字を表現する のに最大でも 2 バイトのエンコーディング(ISO-2022 エンコーディングなど)の みであり、UTF-8 はサポートしません。 <sect2>emacs <p> <!-- First of all, you should read the section "International Character Set Support" (node "International") in the Emacs manual. In particular, note that you need to start Emacs using the command <tscreen><verb> $ emacs -fn fontset-standard </verb></tscreen> so that it will use a font set comprising a lot of international characters. --> まず始めに Emacs マニュアルの "International Character Set Support" セク ション("International" ノード)を読んでください。特に Emacs を起動するに はコマンド<tscreen><verb> $ emacs -fn fontset-standard </verb></tscreen> を実行する必要があることに注意してください。これにより、多くの国の文字の フォントセットを使うことができます。 <!-- In the short term, the emacs-utf package <htmlurl url="http://www.cs.ust.hk/faculty/otfried/Mule/" name="http://www.cs.ust.hk/faculty/otfried/Mule/"> by Otfried Cheong provides a "unicode-utf8" encoding to Emacs, and the Mule-UCS package <htmlurl url="ftp://etlport.etl.go.jp/pub/mule/Mule-UCS/Mule-UCS-0.70.tar.gz" name="ftp://etlport.etl.go.jp/pub/mule/Mule-UCS/Mule-UCS-0.70.tar.gz"> (mirrored at <htmlurl url="http://riksun.riken.go.jp/archives/misc/mule/Mule-UCS/Mule-UCS-0.70.tar.gz" name="http://riksun.riken.go.jp/archives/misc/mule/Mule-UCS/Mule-UCS-0.70.tar.gz">) by Miyashita Hisashi provides a "utf-8" encoding to Emacs. ん You can use either of these packages, or both together. The advantages of the emacs-utf "unicode-utf8" encoding are: it loads faster, and it chooses nicer fonts for non-CJK characters such as math symbols or accented characters. The advantage of the Mule-UCS "utf-8" encoding is: it can apply to a process buffer (such as M-x shell), not only to loading and saving of files. To install the emacs-utf package, compile the program "utf2mule" and install it somewhere in your $PATH, also install unicode.el, muleuni-1.el, unicode-char.el somewhere. Then add the lines --> Otfried Cheong の emacs-utf パッケージ <htmlurl url="http://www.cs.ust.hk/faculty/otfried/Mule/" name="http://www.cs.ust.hk/faculty/otfried/Mule/"> により "unicode-utf-8" エンコーディングを、宮下 尚の Mule-UCS package <htmlurl url="ftp://etlport.etl.go.jp/pub/mule/Mule-UCS/Mule-UCS-0.70.tar.gz" name="ftp://etlport.etl.go.jp/pub/mule/Mule-UCS/Mule-UCS-0.70.tar.gz"> (<htmlurl url="http://riksun.riken.go.jp/archives/misc/mule/Mule-UCS/Mule-UCS-0.70.tar.gz" name="http://riksun.riken.go.jp/archives/misc/mule/Mule-UCS/Mule-UCS-0.70.tar.gz"> にミラーされています)により "utf-8" エンコーディングを Emacs で扱えるよ うになります。両方のパッケージを同時に利用することもできます。emacs-utf "unicode-utf8" エンコーディングの利点はロードが速く、数学記号やアクセン ト付きの文字などの非 CJK 文字を表示にするのにより良いフォントを選んでく れることです。Mule-UCS "utf-8" エンコーディングの利点は、ファイルの読み書きだ けではなく(M-x で起動する) process buffer でもそのエンコードを利用できる ことです。 emacs-utf パッケージをインストールするには "utf2mule" プログラムをコンパ イルしてunicode.el, muleuni-1.el, unicode-char.el と一緒に $PATH のどこ かにインストールし、次の設定を $HOME/.emacs ファイルに追加します。 <tscreen><verb> (setq load-path (cons "/home/user/somewhere/emacs" load-path)) (if (not (string-match "XEmacs" emacs-version)) (progn (require 'unicode) (if (eq window-system 'x) (progn (setq fontset12 (create-fontset-from-fontset-spec "-misc-fixed-medium-r-normal-*-12-*-*-*-*-*-fontset-standard")) (setq fontset13 (create-fontset-from-fontset-spec "-misc-fixed-medium-r-normal-*-13-*-*-*-*-*-fontset-standard")) (setq fontset14 (create-fontset-from-fontset-spec "-misc-fixed-medium-r-normal-*-14-*-*-*-*-*-fontset-standard")) (setq fontset15 (create-fontset-from-fontset-spec "-misc-fixed-medium-r-normal-*-15-*-*-*-*-*-fontset-standard")) (setq fontset16 (create-fontset-from-fontset-spec "-misc-fixed-medium-r-normal-*-16-*-*-*-*-*-fontset-standard")) (setq fontset18 (create-fontset-from-fontset-spec "-misc-fixed-medium-r-normal-*-18-*-*-*-*-*-fontset-standard")) ; (set-default-font fontset15) )))) </verb></tscreen> <!-- to your $HOME/.emacs file. To activate any of the font sets, use the Mule menu item "Set Font/FontSet" or Shift-down-mouse-1. Currently the font sets with height 15 and 13 have the best Unicode coverage, due to Markus Kuhn's 9x15 and 6x13 fonts. To designate a font set as the initial font set at startup, uncomment the <tt>set-default-font</tt> line in the code snippet above. --> フォントセットを有効にするには Mule メニューの "Set Font/FontSet" を選択 するか、Shift を押しながらマウスの左ボタンをクリックします。Markus Kuhn の 9x15 および 6x13 フォントでは、高さ 15 と 13 のフォントセットが Unicode には最適です。フォントセットを初期のフォントセットとして指定する には、上記のコードの <tt>set-default-font</tt> 行をアンコメントします(コ メント(;)を取ります)。 <!-- To install the Mule-UCS package, execute the command --> Mule-UCS パッケージをインストールするには <tscreen><verb> $ emacs -batch -l mucs-comp.el </verb></tscreen> <!-- and install the resulting <tt>un-define.elc</tt> file somewhere. Then add the lines --> を実行し、作成された <tt>un-define.elc</tt> を適当な所にインストールして、 次の行を $HOME/.emacs ファイルに追加します。 <tscreen><verb> (setq load-path (cons "/home/user/somewhere/emacs" load-path)) (if (not (string-match "XEmacs" emacs-version)) (progn (require 'un-define) )) </verb></tscreen> <!-- to your $HOME/.emacs file. --> <!-- In order to open an UTF-8 encoded file, you will type --> UTF-8 でエンコードされたファイルをオープンするには、 <tscreen><verb> M-x universal-coding-system-argument unicode-utf8 RET M-x find-file filename RET </verb></tscreen> <!-- or --> あるいは <tscreen><verb> C-x RET c unicode-utf8 RET C-x C-f filename RET </verb></tscreen> を実行します。 <!-- (or utf-8 instead of unicode-utf8, if you prefer Mule-UCS). --> (Mule-UCS が好みであれば、unicode-utf8 のかわりに utf-8 を実行します) <!-- In order to start a shell buffer with UTF-8 I/O, you will type --> shell バッファを UTF-8 I/O で実行するには、下記を実行します。 <tscreen><verb> M-x universal-coding-system-argument utf-8 RET M-x shell RET </verb></tscreen> <!-- (This works with Mule-UCS only.) --> (Mule-UCS のみで動作します) <!-- Note that all this works with Emacs in windowing mode only, not in terminal mode. --> 上記は Emacs がターミナルモードではなく、ウィンドウモードの時のみ 動作します。 <!-- Richard Stallman plans to add integrated UTF-8 support to Emacs in the long term, and so does the XEmacs developers group. --> Richard Stallman は将来的に UTF-8 サポートを Emacs に統合しようと計画し ています。同じく XEmacs 開発グループもです。 <!-- Related documentation: The "Multilingual Emacs and Unicode" page <htmlurl url="http://www.geocities.com/ResearchTriangle/Campus/6475/index.html" name="http://www.geocities.com/ResearchTriangle/Campus/6475/index.html"> by <htmlurl url="mailto:golconda@yahoo.co.jp" name="<golconda@yahoo.co.jp>">. --> 関連文書: <htmlurl url="mailto:golconda@yahoo.co.jp" name="<golconda@yahoo.co.jp>"> のページ "Multilingual Emacs and Unicode" <htmlurl url="http://www.geocities.com/ResearchTriangle/Campus/6475/index.html" name="http://www.geocities.com/ResearchTriangle/Campus/6475/index.html"> <sect2>xemacs <p> <!-- (This section is written by Gilbert Baumann.) --> (このセクションは Gilbert Baumann が書きました) <!-- Here is how to teach XEmacs (20.4 configured with MULE) the UTF-8 encoding. Unfortunately you need its sources to be able to patch it. --> これは Xemacs(のバージョン 20.4 に MULE を設定(configured)した) で UTF-8 エンコードを扱えるようにする方法です。残念ながらソースにパッチをあてる 必要があります。 <!-- First you need these files provided by Tomohiko Morioka: --> 始めに Tomohiko Morioka による、これらのファイルが必要になります。 <htmlurl url="http://turnbull.sk.tsukuba.ac.jp/Tools/XEmacs/xemacs-21.0-b55-emc-b55-ucs.diff" name="http://turnbull.sk.tsukuba.ac.jp/Tools/XEmacs/xemacs-21.0-b55-emc-b55-ucs.diff"> <!-- and --> および <htmlurl url="http://turnbull.sk.tsukuba.ac.jp/Tools/XEmacs/xemacs-ucs-conv-0.1.tar.gz" name="http://turnbull.sk.tsukuba.ac.jp/Tools/XEmacs/xemacs-ucs-conv-0.1.tar.gz"> <!-- The .diff is a diff against the C sources. The tar ball is elisp code, which provides lots of code tables to map to and from Unicode. As the name of the diff file suggests it is against XEmacs-21; I needed to help `patch' a bit. The most notable difference to my XEmacs-20.4 sources is that file-coding.[ch] was called mule-coding.[ch]. --> diff ファイルは C のソースの差分です。tar 玉は elisp のコードで、 Unicode との相互変換のための多くのコードテーブルを提供します。diff ファ イルの名前からわかるようにこれは XEmacs-21 用ですから、私が使っている XEmacs-20.4 では多少パッチを修正する必要がありました。XEmacs-20.4 のソー スとの最も大きな違いは file-coding.[ch] が mule-coding.[ch] となっていた ことです。(訳注:tarball(tar 玉や tar ボールと呼ばれます)は、tar で固め られたファイルのことです) <!-- For those unfamilar with the XEmacs-MULE stuff (as I am) a quick guide: --> (私のように) XEmacs-MULE に慣れていない方へのクイックガイドです: <!-- What we call an encoding is called by MULE a `coding-system'. The most important commands are: --> MULE ではエンコーディングを `coding-system' と呼びます。 最も重要なコマンドは、 <tscreen><verb> M-x set-file-coding-system M-x set-buffer-process-coding-system [comint buffers] </verb></tscreen> <!-- and the variable `file-coding-system-alist', which guides `find-file' to guess the encoding used. After stuff was running, the very first thing I did was <htmlurl url="ftp://ftp.ilog.fr/pub/Users/haible/utf8/gb-hacks.el" name="this">. --> と、使用されているエンコーディングを調べる時に `find-file' 関数が使用す る変数 `file-coding-system-alist' です。実行後にすぐに私が行なったのは <htmlurl url="ftp://ftp.ilog.fr/pub/Users/haible/utf8/gb-hacks.el" name="これ"> です。 <!-- This code looks into the special mode line introduced by -*- somewhere in the first 600 bytes of the file about to opened; if now there is a field "Encoding: xyz;" and the xyz encoding ("coding system" in Emacs speak) exists, choose that. So now you could do e.g. --> このコードはオープンしようとしているファイルの先頭 600 バイトまで、-*- で始まっている special mode line を探します。"Encoding: xyz;" フィールド があり、xyz エンコーディング(Emacs では "coding system" ですね)が存在し てた場合には、このようにして XEmacs を utf-8 モードにすることができます。 <tscreen><verb> ;;; -*- Mode: Lisp; Syntax: Common-Lisp; Package: CLEX; Encoding: utf-8; -*- </verb></tscreen> <!-- and XEmacs goes into utf-8 mode here. --> <!-- Atfer everything was running I defined \u03BB (greek lambda) as a macro like: --> 全てがうまく動作したあと、\u03BB(ギリシャ語のラムダ) というマクロを定義しました。 <!-- <tscreen><verb> (defmacro \u03BB (x) `(lambda .,x)) </verb></tscreen> --> <tscreen><verb> (defmacro \u03BB (x) `(lambda .,x)) </verb></tscreen> <sect2>nedit <p> (工事中) <!-- 実際(原文)は空のままだけど、それだと何だかミスのように見えるんで 工事中にしておく --> <sect2>xedit <p> <!-- In theory, xedit should be able to edit UTF-8 files if you set the locale accordingly (see above), and add the line "Xedit*international: true" to your $HOME/.Xdefaults file. In practice, it will recognize UTF-8 encoding of non-ASCII characters, but will display them as sequences of "@" characters. --> 理論上は xedit はロケールを適切に設定し(上記を参照)、$HOME/.Xdefaults ファ イルに "Xedit*international: true" 行を追加すれば UTF-8 ファイルを編集で きるはずですが、実際には UTF-8 エンコーディングされた非 ASCII 文字を認識 してはいますが、連続した "@" 文字で表示されてしまいます。 <sect2>axe <p> <!-- In theory, axe should be able to edit UTF-8 files if you set the locale accordingly (see above), and add the line "Axe*international: true" to your $HOME/.Xdefaults file. In practice, it will simply dump core. --> ロケールを適切に設定し(上記を参照)、$HOME/.Xdefaults ファイルに "Axe*international: true" 行を追加すれば、理論上 axe は UTF-8 ファイルを 編集できるはずですが、実際には単に core を吐くだけです。 <sect2>pico <p> (工事中) <sect1> <!-- Mailers --> メーラ <p> <!-- MIME: RFC 2279 defines UTF-8 as a MIME charset, which can be transported under the 8bit, quoted-printable and base64 encodings. The older MIME UTF-7 proposal (RFC 2152) is considered to be deprecated and should not be used any further. --> MIME: RFC 2279 は UTF-8 を MIME 文字セットとして定義しています。 MIME は 8 ビットの表示可能な base64 エンコーディングで転送することができ ます。古い MIME UTF-7 プロポーザル(RFC 2152)は反対されている(deprecated) ため、使用するべきではありません。 <!-- Mail clients released after January 1, 1999, should be capable of sending and displaying UTF-8 encoded mails, otherwise they are considered deficient. But these mails have to carry the MIME labels --> 1999 年 1 月 1 日以降にリリースされたメールクライアントは UTF-8 エンコー ドされたメールの送信や表示を行えるはずです。もし扱えない場合には欠陥 (deficient)と思われます。ですがこれらのメールは MIME ラベルである以下の 行を含む必要があります。 <tscreen><verb> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit </verb></tscreen> <!-- Simply piping an UTF-8 file into "mail" without caring about the MIME labels will not work. --> MIME ラベルなしで、UTF-8 ファイルを単純に "mail" コマンドにパイプで渡し た場合には、正しく扱われません。 <!-- Mail client implementors should take a look at --> メールクライアントの実装者は <htmlurl url="http://www.imc.org/imc-intl/" name="http://www.imc.org/imc-intl/"> <!-- and --> や <htmlurl url="http://www.imc.org/mail-i18n.html" name="http://www.imc.org/mail-i18n.html"><!--.--> に目を通すべきです。 <!-- Now about the individual mail clients (or "mail user agents"): --> これから個々のメールクライアント(もしくは "mail user agents"(MUA)と 呼びます) について見ていきます。 <sect2>pine <p> <!-- The situation for an unpatched pine version 4.10 is as follows. --> パッチのあたっていない pine version 4.10 のはこのようになっています。 <!-- Pine does not do character set conversions. But it allows you to view UTF-8 mails in an UTF-8 text window (Linux console or xterm). --> Pine は文字セットのコンバートを行いませんが、UTF-8 のテキストウィンドウ (Linux コンソールか xterm)で UTF-8 のメールを閲覧することができます。 <!-- Normally, Pine will warn about different character sets each time you view an UTF-8 encoded mail. To get rid of this warning, choose S (setup), then C (config), then change the value of "character-set" to UTF-8. This option will not do anything, except to reduce the warnings, as Pine has no built-in knowledge of UTF-8. --> 通常 Pine は UTF-8 エンコードされたメールを閲覧するたびに、文字セットが 異なっていると警告をします。この警告を出さないようにするには S(setup)を 選択し、次に C(config)、そして "character-set" の値を UTF-8 に変更します。 Pine は UTF-8 を識別しないため、このオプションは警告表示を抑制する以外に は何も行ないません。 <!-- Also note that Pine's notion of Unicode characters is pretty limited: It will display Latin and Greek characters, but not other kinds of Unicode characters. --> Pine の Unicode 文字の認識は非常に限定されていることにも注意してください。 ラテン語やギリシャ語の文字は表示しますが、他の種類の Unicode 文字は表示 しません。 <!-- A patch by Robert Brady --> Robert Brady のパッチ <htmlurl url="mailto:rwb197@ecs.soton.ac.uk" name="<rwb197@ecs.soton.ac.uk>"> <htmlurl url="http://www.ents.susu.soton.ac.uk/~robert/pine-utf8-0.1.diff" name="http://www.ents.susu.soton.ac.uk/~robert/pine-utf8-0.1.diff"> <!-- adds UTF-8 support to Pine. With this patch, it decodes and prints headers and bodies properly. The patch depends on the GNOME libunicode --> は Pine に UTF-8 サポートを追加します。このパッチによりヘッダや本文のデ コード、表示が正常に行われます。このパッチは GNOME の libunicode <htmlurl url="http://cvs.gnome.org/lxr/source/libunicode/" name="http://cvs.gnome.org/lxr/source/libunicode/"><!--.--> に依存しています。 <!-- However, alignment remains broken in many places; replying to a mail does not cause the character set to be converted as appropriate; and the editor, pico, cannot deal with multibyte characters. --> しかし多くの場合、アラインメントの問題は解消されていません。メールの リプライは文字セットのコンバートを正しく行えず、また pico エディターは マルチバイト文字を扱えません。 <sect2>kmail <p> <!-- kmail (as of KDE 1.0) does not support UTF-8 mails at all. --> (KDE 1.0 の時点では)kmail は UTF-8 メールをまったくサポートしていません。 <sect2>Netscape Communicator <p> <!-- Netscape Communicator's Messenger can send and display mails in UTF-8 encoding, but it needs a little bit of manual user intervention. --> Netscape Communicator の Messenger は、UTF-8 エンコードされたメールの 送信や表示を行うことができますが、多少の手作業が必要となります。 <!-- To send an UTF-8 encoded mail: After opening the "Compose" window, but before starting to compose the message, select from the menu "View -> Character Set -> Unicode (UTF-8)". Then compose the message and send it. --> UTF-8 エンコードされたメールを送信するためには、メールを作成する前に "Compose" ウィンドウを開き、メニューの "View -> Character Set -> Unicode (UTF-8)" を選択します。その後メールの作成、送信を行います。 <!-- When you receive an UTF-8 encoded mail, Netscape unfortunately does not display it in UTF-8 right away, and does not even give a visual clue that the mail was encoded in UTF-8. You have to manually select from the menu "View -> Character Set -> Unicode (UTF-8)". --> UTF-8 でエンコードされたメールを受け取った場合、Netscape は残念ながら 正 しく UTF-8 で表示しません。メールが UTF-8 でエンコーディングされていると 表示することすらできません。手動でメニューの "View -> Character Set -> Unicode (UTF-8)" を選択する必要があります。 <!-- For displaying UTF-8 mails, Netscape uses different fonts. You can adjust your font settings in the "Edit -> Preferences -> Fonts" dialog; choose the "Unicode" font category. --> Netscape は UTF-8 のメールを表示するために別のフォントを使用します。フォ ントの設定は "Edit -> Preferences -> Fonts" ダイアログで調整できますから、 "Unicode" フォントカテゴリーを選択します。 <sect2>emacs (rmail, vm) <p> (工事中) <sect2>mutt <p> <!-- mutt-1.0, as available from --> mutt-1.0 <htmlurl url="http://www.mutt.org/" name="http://www.mutt.org/"><!--,--> <!-- contains only rudimentary UTF-8 support. For full UTF-8 support, there are patches by Edmund Grimley Evans at --> の UTF-8 サポートは原始的なものだけです。UTF-8 を完全にサポートするため の Edmund Grimley Evans のパッチがあります。 <htmlurl url="http://www.rano.demon.co.uk/mutt.html" name="http://www.rano.demon.co.uk/mutt.html"><!--.--> <sect1> <!-- Text processing --> テキスト操作 <p> <sect2>groff <p> <!-- groff, the GNU implementation of the traditional Unix text processing system troff/nroff, can output UTF-8 formatted text. You need the newest snapshot (<tt>groff-current.tar.gz</tt> from <htmlurl url="http://groff.ffii.org/" name="http://groff.ffii.org/">). Then use `<tt>groff -Tutf8</tt>' instead of `<tt>groff -Tlatin1</tt>' or `<tt>groff -Tascii</tt>'. --> 伝統的な Unix テキスト操作システム troff/nroff の GNU 版である groff は UTF-8 でフォーマットされたテキストを出力できます。このためには最新のスナッ プショット (<htmlurl url="http://groff.ffii.org/" name="http://groff.ffii.org/"> の <tt>groff-current.tar.gz</tt>) で、 `<tt>groff -Tlatin1</tt>' や `<tt>groff -Tascii</tt>' の代わりに `<tt>groff -Tutf8</tt>' を実行する必要があります。 <sect2>TeX <p> <!-- The teTeX 0.9 (and newer) distribution contains an Unicode adaptation of TeX, called Omega (<htmlurl url="http://www.gutenberg.eu.org/omega/" name="http://www.gutenberg.eu.org/omega/">, <htmlurl url="ftp://ftp.ens.fr/pub/tex/yannis/omega" name="ftp://ftp.ens.fr/pub/tex/yannis/omega">). Together with the unicode.tex file contained in <htmlurl url="ftp://ftp.ilog.fr/pub/Users/haible/utf8/utf8-tex-0.1.tar.gz" name="utf8-tex-0.1.tar.gz"> it enables you to use UTF-8 encoded sources as input for TeX. A thousand of Unicode characters are currently supported. --> teTeX 0.9 以降には Omega と呼ばれる、TeX に Unicode への対応を追加したも のがあります。(<htmlurl url="http://www.gutenberg.eu.org/omega/" name="http://www.gutenberg.eu.org/omega/">, <htmlurl url="ftp://ftp.ens.fr/pub/tex/yannis/omega" name="ftp://ftp.ens.fr/pub/tex/yannis/omega">) さらに <htmlurl url="ftp://ftp.ilog.fr/pub/Users/haible/utf8/utf8-tex-0.1.tar.gz" name="utf8-tex-0.1.tar.gz"> の unicode.tex ファイルを使うと、TeX のソー スとして UTF-8 でエンコードされたものを扱うことができます。現在、 数多くの Unicode 文字がサポートされています。 <!-- All that changes is that you run `omega' (instead of `tex') or `lambda' (instead of `latex'), and insert the following lines at the head of your source input. --> これらの変更点はソースの先頭に次の行を追加し、(`tex'のかわりに) `omega' や (`latex' のかわりに)`lambda' を実行することにより利用することできます。 <!-- <tscreen><verb> \ocp\TexUTF=inutf8 \InputTranslation currentfile \TexUTF </verb></tscreen> <tscreen><verb> \input unicode </verb></tscreen> --> <tscreen><verb> \ocp\TexUTF=inutf8 \InputTranslation currentfile \TexUTF </verb></tscreen> <tscreen><verb> \input unicode </verb></tscreen> <!-- Other maybe related links: --> 関連するリンク: <htmlurl url="http://www.dante.de/projekte/nts/NTS-FAQ.html" name="http://www.dante.de/projekte/nts/NTS-FAQ.html">, <htmlurl url="ftp://ftp.dante.de/pub/tex/language/chinese/CJK/" name="ftp://ftp.dante.de/pub/tex/language/chinese/CJK/">. <sect1> <!-- Databases --> データーベース <p> <sect2>PostgreSQL <p> <!-- PostgreSQL 6.4 or newer can be built with the configuration option <tt>−−with-mb=UNICODE</tt>. --> PostgreSQL 6.4 以降ではオプション <tt>--with-mb=UNICODE</tt> を指定してバイナリを作成することができます。 <sect1> <!-- Other text-mode applications --> その他のテキストモードのアプリケーション <p> <sect2>less <p> <!-- Get and install <htmlurl url="http://www.flash.net/~marknu/less/less-346.tar.gz" name="http://www.flash.net/~marknu/less/less-346.tar.gz"> with the patch <htmlurl url="ftp://ftp.ilog.fr/pub/Users/haible/utf8/less-346-utf8.diff" name="less-346-utf8.diff"> by Robert Brady <htmlurl url="mailto:rwb197@ecs.soton.ac.uk" name="<rwb197@ecs.soton.ac.uk>">. --> これ <htmlurl url="http://www.flash.net/~marknu/less/less-346.tar.gz" name="http://www.flash.net/~marknu/less/less-346.tar.gz"> に Robert Brady <htmlurl url="mailto:rwb197@ecs.soton.ac.uk" name="<rwb197@ecs.soton.ac.uk>"> のパッチ <htmlurl url="ftp://ftp.ilog.fr/pub/Users/haible/utf8/less-346-utf8.diff" name="less-346-utf8.diff"> をあててインストールします。 <!-- Then set the environment variable LESSCHARSET: --> そして次に環境変数 LESSCHARSET をセットします。 <tscreen><verb> $ export LESSCHARSET=utf-8 </verb></tscreen> <!-- If you also have a LESSKEY environment variable set, also make sure that the file it points to does not define LESSCHARSET. If necessary, regenerate this file using the `lesskey' command, or unset the LESSKEY environment variable. --> 環境変数 LESSKEY をセットしている場合には、その変数が指している lesskey ファイルで LESSCHART を定義していないことを確認してください。必要に応じ て `lesskey' コマンドでファイルの再生成や、LESSKEY 環境変数の unset を行ってください。 <sect2>expand, wc <p> <!-- Get the GNU textutils-2.0 and apply the patch --> GNU textutils-2.0 を入手し、パッチ <htmlurl url="ftp://ftp.ilog.fr/pub/Users/haible/utf8/textutils-2.0.diff" name="textutils-2.0.diff"><!--,--> <!-- then configure, add "#define HAVE_MBRTOWC 1", "#define HAVE_FGETWC 1", "#define HAVE_FPUTWC 1" to config.h. In src/Makefile, modify CFLAGS and LDFLAGS so that they include the directories where libutf8 is installed. Then rebuild. --> をあてて "#define HAVE_MBRTOWC 1", "#define HAVE_FGETWC 1", "#define HAVE_FPUTWC 1" を config.h に追加し、src/Makefile の CFLAGS と LDFLAGS が libutf8 がインストールされているディレクトリを include するようにして リビルドしてください。 <sect2>col, colcrt, colrm, column, rev, ul <p> <!-- Get the util-linux-2.9y package, configure it, then define ENABLE_WIDECHAR in defines.h, change the "#if 0" to "#if 1" in lib/widechar.h. In text-utils/Makefile, modify CFLAGS and LDFLAGS so that they include the directories where libutf8 is installed. Then rebuild. --> util-linux-2.9y パッケージを入手して configure し、defines.h の ENABLE_WIDECHAR を定義し(訳注:#define ENABLE_WIDECHAR)、lib/widechar.h の "#if 0" を "#if 1" にします。そして text-utils/Makefile の CFLAGS と LDFLAGS が libutf8 がインストールされているディレクトリを include するよ うにしてリビルドしてください。 <sect2>figlet <p> <!-- figlet 2.2 has an option for UTF-8 input: "figlet -C utf8" --> figlet 2.2 には UTF-8 で入力するオプション "figlet -C utf8" があります。 <sect2>kermit <p> <!-- The serial communications program C-Kermit --> シリアル通信用プログラム C-Kermit <htmlurl url="http://www.columbia.edu/kermit/" name="http://www.columbia.edu/kermit/"><!--,--> <!-- in versions 7.0beta10 or newer, understands the file and transfer encodings UTF-8 and UCS-2, and understands the terminal encoding UTF-8. Documentation of these features can be found in --> のバージョン 7.0beta10 以降では、ファイルおよび通信のエンコーディングとし て UTF-8 と UCS-2 を、ターミナルでのエンコーディングとして UTF-8 を使用 することができます。エンコーディングに関するドキュメントは <htmlurl url="ftp://kermit.columbia.edu/kermit/test/text/ckermit2.txt" name="ftp://kermit.columbia.edu/kermit/test/text/ckermit2.txt"><!--.--> にあります。 <sect1> <!-- Other X11 applications --> その他の X11 アプリケーション <p> <!-- Work on an UTF-8 locale for X11 Xlib is underway. --> X11 Xlib の UTF-8 ロケールは現在開発中です。 <sect> <!-- Making your programs Unicode aware --> あなたのプログラムで Unicode を扱えるようにする <p> <sect1>C/C++ <p> <!-- The C `<tt>char</tt>' type is 8-bit and will stay 8-bit because it denotes the smallest addressable data unit. Various facilities are available: --> C 言語の `<tt>char</tt>' 型は 8 ビットですが、 これは扱える最小のサイズだからです。 <sect2> <!-- For normal text handling --> 通常のテキストハンドリング <p> <!-- The ISO/ANSI C standard contains, in an amendment which was added in 1995, a "wide character" type `<tt>wchar_t</tt>', a set of functions like those found in <tt><string.h></tt> and <tt><ctype.h></tt> (declared in <tt><wchar.h></tt> and <tt><wctype.h></tt>, respectively), and a set of conversion functions between `<tt>char *</tt>' and `<tt>wchar_t *</tt>' (declared in <tt><stdlib.h></tt>). --> 1995 年に ISO/ANSI C standard に追加された修正条項に記述されているのは、 "wide character/ワイド文字" 型である `<tt>wchar_t</tt>'と、 <tt><string.h></tt> および <tt><ctype.h></tt> (それぞれ <tt><wchar.h></tt> および <tt><wctype.h></tt> で宣言されてい ます)にある一連の関数と、`<tt>char *</tt>' と `<tt>wchar_t *</tt>' 間の 一連の 変換関数 (<tt><stdlib.h></tt> で宣言されています)です。 <!-- Good references for this API are --> これらの API の良いリファレンス <itemize> <item> <!-- the GNU libc-2.1 manual, chapters 4 "Character Handling" and 6 "Character Set Handling", --> GNU libc-2.1 マニュアルの 4 章 "Character Handling" と 6 章 "Character Set Handling" <item> <!-- the manual pages <htmlurl url="ftp://ftp.ilog.fr/pub/Users/haible/utf8/man-mbswcs.tar.gz" name="man-mbswcs.tar.gz">, now contained in <htmlurl url="ftp://ftp.win.tue.nl/pub/linux-local/manpages/man-pages-1.28.tar.gz" name="ftp://ftp.win.tue.nl/pub/linux-local/manpages/man-pages-1.28.tar.gz">, --> マニュアル<htmlurl url="ftp://ftp.ilog.fr/pub/Users/haible/utf8/man-mbswcs.tar.gz" name="man-mbswcs.tar.gz">、現在は <htmlurl url="ftp://ftp.win.tue.nl/pub/linux-local/manpages/man-pages-1.28.tar.gz" name="ftp://ftp.win.tue.nl/pub/linux-local/manpages/man-pages-1.28.tar.gz"> に含まれています。 <item> <!-- the OpenGroup's introduction --> OpenGroup のイントロダクション <htmlurl url="http://www.unix-systems.org/version2/whatsnew/login_mse.html" name="http://www.unix-systems.org/version2/whatsnew/login_mse.html"><!--,--> <item> <!-- the OpenGroup's Single Unix specification --> OpenGroup の Single Unix specification <htmlurl url="http://www.UNIX-systems.org/online.html" name="http://www.UNIX-systems.org/online.html"><!--,--> <item> <!-- the ISO/IEC 9899:1999 (ISO C 99) standard. The latest draft before it was adopted is called n2794. You find it at --> ISO/IEC 9899:1999 (ISO C 99) standard<newline> 採用(adopted)前の n2794 と呼ばれている最新のドラフトは <htmlurl url="ftp://ftp.csn.net/DMK/sc22wg14/review/" name="ftp://ftp.csn.net/DMK/sc22wg14/review/"> <!-- or --> もしくは <htmlurl url="http://java-tutor.com/docs/c/" name="http://java-tutor.com/docs/c/"><!--.--> <item> <!-- Clive Feather's introduction --> Clive Feather のイントロダクション <htmlurl url="http://www.lysator.liu.se/c/na1.html" name="http://www.lysator.liu.se/c/na1.html"><!--,--> <item> <!-- the Dinkumware C library reference --> the Dinkumware C library リファレンス <htmlurl url="http://www.dinkumware.com/htm_cl/" name="http://www.dinkumware.com/htm_cl/"><!--.--> </itemize> <!-- Advantages of using this API: --> これらの API を使う利点 <itemize> <item> <!-- It's a vendor independent standard. --> ベンダーに依存しない標準です。 <item> <!-- The functions do the right thing, depending on the user's locale. All a program needs to call is <tt>setlocale(LC_ALL,"");</tt>. --> 関数はユーザーのロケールに応じた正しい動作をします。全てのプログラムで <tt>setlocale(LC_ALL,"");</tt> を呼びだす必要があります。 </itemize> <!-- Drawbacks of this API: --> これらの API の欠点 <itemize> <item> <!-- Some of the functions are not multithread-safe, because they keep a hidden internal state between function calls. --> 呼びだし毎に使用する内部的な状態フラグを保持しているため、いくつかの関数は マルチスレッドセーフではありません。 <item> <!-- There is no first-class locale datatype. Therefore this API cannot reasonably be used for anything that needs more than one locale or character set at the same time. --> どのような時にでも使用できるというロケールデータタイプはありません。つま りこれらの API は、1 つ以上のロケールや文字セットを同時に使用しなければ ならない時には、うまく動作しません。 <item> <!-- The OS support for this API is not good on most OSes. --> 多くの OS で、これらの API のサポートは満足いくものではありません。 </itemize> <sect3> <!-- Portability notes --> 可搬性(Portability)について <p> <!-- A `<tt>wchar_t</tt>' may or may not be encoded in Unicode; this is platform and sometimes also locale dependent. A multibyte sequence `<tt>char *</tt>' may or may not be encoded in UTF-8; this is platform and sometimes also locale dependent. --> `<tt>wchar_t</tt>' が Unicode で、マルチバイトの文字列 `<tt>char *</tt>' が UTF-8 でエンコードされているかどうかはプラットフォームや、時にはロカー ルにも依存しています。 <!-- In detail, here is what the <htmlurl url="http://www.UNIX-systems.org/online.html" name="Single Unix specification"> says about the `<tt>wchar_t</tt>' type: --> <htmlurl url="http://www.UNIX-systems.org/online.html" name="Single Unix specification"> では `<tt>wchar_t</tt>' 型についてこのように述べられています: <!-- <em>All wide-character codes in a given process consist of an equal number of bits. This is in contrast to characters, which can consist of a variable number of bytes. The byte or byte sequence that represents a character can also be represented as a wide-character code. Wide-character codes thus provide a uniform size for manipulating text data. A wide-character code having all bits zero is the null wide-character code, and terminates wide-character strings. The wide-character value for each member of the Portable Character Set </em> (i.e. ASCII) <em> will equal its value when used as the lone character in an integer character constant. Wide-character codes for other characters are locale- and implementation-dependent. State shift bytes do not have a wide-character code representation.</em> --> <quote> プロセスの全てのワイド文字コードは、固定長のビットで構成されている。これ に対して文字(character)を構成するバイト数は可変である。文字を表現するバ イト(あるいはバイトの並び)は、ワイド文字コードとして表現することもできる。 つまりワイド文字コードにより、固定長でテキストデータを扱うことができる。 全ビットがゼロのワイド文字コードはヌルのワイド文字コードで、ワイド文字の 文字列の終りを表す。可搬性のある文字セット (著者注:つまり ASCII) を表現 するために使用されるワイド文字の値は、1 文字で文字を表している時にはその (ASCII での)値に等しくなる。その他の文字のワイド文字コードはロケールおよ び実装に依存する。状態シフトバイトにはワイド文字コード表現はない。 </quote> <!-- One particular consequence is that in portable programs you shouldn't use non-ASCII characters in string literals. That means, even though you know the Unicode double quotation marks have the codes U+201C and U+201D, you shouldn't write a string literal <tt>L"\u201cHello\u201d, he said"</tt> or <tt>"\xe2\x80\x9cHello\xe2\x80\x9d, he said"</tt> in C programs. Instead, use GNU gettext, write it as <tt>gettext("'Hello', he said")</tt>, and create a message database en.UTF-8.po which translates "'Hello', he said" to "\u201cHello\u201d, he said". --> 結論としては、可搬性のあるプログラムでは非 ASCII 文字を文字列のリテラル として使うべきではないということです。つまり Unicode の二重引用符がコー ド U+201C および U+201D ということを知っていたとしても、C のプログラムでは 文字列のリテラル <tt>L"\u201cHello\u201d, he said"</tt> や <tt>"\xe2\x80\x9cHello\xe2\x80\x9d, he said"</tt> を使用すべきではありません。そのかわりに GNU gettext を使用し て <tt>gettext("'Hello', he said")</tt> と書き、メッセージデータベース en.UTF-8.po を作成して "'Hello', he said" を "\u201cHello\u201d, he said" に翻訳します。 <!-- Here is a survey of the portability of the ISO/ANSI C facilities on various Unix flavours. GNU glibc-2.2 will support all of it, but for now we have the following picture. --> 以下は各 UNIX における ISO/ANSI C 機能の可搬性を調査したものです。GNU glibc-2.2 はこれら全てをサポートする予定ですが、現在の所は(まだ出ていな いため)以下のもので我慢するしかありません。 <descrip> <tag>GNU glibc-2.0.x, glibc-2.1.x</tag> <itemize> <!-- <item><wchar.h> and <wctype.h> exist. <item>Has wcs/mbs functions, but no fgetwc/fputwc/wprintf. <item>No UTF-8 locale. <item>mbrtowc returns EILSEQ for bytes >= 0x80. --> <item><wchar.h> および <wctype.h> があります <item>wcs/mbs 関数がありますが、fgetwc/fputwc/wprintf はありません <item>UTF-8 ロケールはありません <item>mbrtowc は文字コードが 0x80 以上の場合、EILSEQ を返します </itemize> <tag>Solaris 2.7</tag> <itemize> <!-- <item><wchar.h> and <wctype.h> exist. <item>Has wcs/mbs functions, fgetwc/fputwc/wprintf, everything. <item>Has the following UTF-8 locales: en_US.UTF-8, de.UTF-8, es.UTF-8, fr.UTF-8, it.UTF-8, sv.UTF-8. <item>mbrtowc returns -1/EILSEQ (instead of -2) for bytes >= 0x80. --> <item><wchar.h> および <wctype.h> があります <item>wcs/mbs 関数、fgetwc/fputwc/wprintf 関数、全てあります。 <item>次の UTF-8 ロケールがあります: en_US.UTF-8, de.UTF-8, es.UTF-8, fr.UTF-8, it.UTF-8, sv.UTF-8. <item>mbrtowc は文字コードが 0x80 以上の場合、(-2 ではなく) -1/EILSEQ を返します </itemize> <tag>OSF/1 4.0d</tag> <itemize> <!-- <item><wchar.h> and <wctype.h> exist. <item>Has wcs/mbs functions, fgetwc/fputwc/wprintf, everything. <item>Has an add-on universal.utf8@ucs4 locale, see "man 5 unicode". <item>mbrtowc does not know about UTF-8. --> <item><wchar.h> および <wctype.h> があります <item>wcs/mbs 関数、fgetwc/fputwc/wprintf 関数、全てあります <item>アドオンの universal.utf8@ucs4 ロケールがあります。"man 5 unicode" を参照してください <item>mbrtowc は UTF-8 を扱えません </itemize> <tag>Irix 6.5</tag> <itemize> <!-- <item><wchar.h> and <wctype.h> exist. <item>Has wcs/mbs functions and fgetwc/fputwc, but not wprintf. <item>Has no multibyte locales. <item>Has only a dummy definition for mbstate_t. <item>Doesn't have mbrtowc. --> <item><wchar.h> および <wctype.h> があります <item>wcs/mbs 関数、fgetwc/fputwc 関数はありますが、wprintf はありません <item>マルチバイトのロケールはありません <item>mbstate_t のダミーな定義しかありません <item>mbrtowc がありません </itemize> <tag>HP-UX 11.00</tag> <itemize> <!-- <item><wchar.h> exists, <wctype.h> does not. <item>Has wcs/mbs functions and fgetwc/fputwc, but not wprintf. <item>Has a C.utf8 locale. <item>Doesn't have mbstate_t. <item>Doesn't have mbrtowc. --> <item><wchar.h> はありますが、<wctype.h> はありません <item>wcs/mbs 関数、fgetwc/fputwc 関数はありますが、wprintf はありません <item>C.utf8 ロケールがあります <item>mbstate_t がありません <item>mbrtowc がありません </itemize> <tag>AIX 4.2</tag> <itemize> <!-- <item><wchar.h> exists, <wctype.h> does not - instead use <ctype.h> and <wchar.h>. <item>Has wcs/mbs functions and fgetwc/fputwc, but not wprintf. <item>Has the following UTF-8 locales: ET_EE.UTF-8, LT_LT.UTF-8, LV_LV.UTF-8, ZH_CN.UTF-8. <item>Doesn't have mbstate_t. <item>Doesn't have mbrtowc. --> <item><wchar.h> はありますが、<wctype.h> はありません。 代わりとして <ctype.h> と <wchar.h> を使います <item>wcs/mbs 関数、fgetwc/fputwc 関数はありますが、wprintf はありません <item>次の UTF-8 ロケールがあります: ET_EE.UTF-8, LT_LT.UTF-8, LV_LV.UTF-8, ZH_CN.UTF-8. <item>mbstate_t がありません <item>mbrtowc がありません </itemize> </descrip> <!-- As a consequence, I recommend to use the restartable and multithread-safe wcsr/mbsr functions, forget about those systems which don't have them (Irix, HP-UX, AIX), and use the UTF-8 locale plug-in libutf8_plug.so (see below) on those systems which permit you to compile programs which use these wcsr/mbsr functions (Linux, Solaris, OSF/1). --> 以上より、再開可能(restartable)かつマルチスレッドセーフな wcsr/mbsr 関数 を使うことをお勧めします。関数が無いシステム(Irix, HP-UX, AIX)のことは忘れ てしまって、UTF-8 ロケール のプラグイン libutf8_plug.so(下記参照のこと)を、 wcsr/mbsr 関数を使用したプログラムをコンパイルできるシステム(Linux, Solaris, OSF/1)で使用しましょう。 <!-- A similar advice, given by Sun in <htmlurl url="http://www.sun.com/software/white-papers/wp-unicode/" name="http://www.sun.com/software/white-papers/wp-unicode/">, section "Internationalized Applications with Unicode", is: --> Sun の同様なアドバイス<htmlurl url="http://www.sun.com/software/white-papers/wp-unicode/" name="http://www.sun.com/software/white-papers/wp-unicode/"> の "Internationalized Applications with Unicode" セクションにはこのように書 かれています: <!-- <em>To properly internationalize an application, use the following guidelines:</em> --> <quote> 正しくアプリケーションを国際化するには、次のガイドラインに沿う必要がある: </quote> <!-- <enum> <item><em>Avoid direct access with Unicode. This is a task of the platform's internationalization framework.</em> <item><em>Use the POSIX model for multibyte and wide-character interfaces.</em> <item><em>Only call the APIs that the internationalization framework provides for language and cultural-specific operations.</em> <item><em>Remain code-set independent.</em> </enum> --> <enum> <item>Unicode への直接のアクセスは避ける。 これはプラットフォーム上の国際化フレームワークの仕事です <item>POSIX モデルの、マルチバイトおよび ワイド文字インターフェースを使用する <item>国際化フレームワークの提供する言語および文化依存操作の API のみを呼びだす <item>コードセット非依存のままにする </enum> <!-- If, for some reason, in some piece of code, you really have to assume that `wchar_t' is Unicode (for example, if you want to do special treatment of some Unicode characters), you should make that piece of code conditional upon the result of <tt>is_locale_utf8()</tt>. Otherwise you will mess up your program's behaviour in different locales or other platforms. The function <tt>is_locale_utf8</tt> is declared in <htmlurl url="ftp://ftp.ilog.fr/pub/Users/haible/utf8/utf8locale.h" name="utf8locale.h"> and defined in <htmlurl url="ftp://ftp.ilog.fr/pub/Users/haible/utf8/utf8locale.c" name="utf8locale.c">. --> もし何かの理由で、`wchar_t' が Unicode だとどうしても仮定しなければなら ない(例えば一部の Unicode 文字に特別な処理を行ないたい時)ようなコードが 必要な時には、コードのその部分を <tt>is_locale_utf8()</tt> の結果を見て 動作するようにするべきです。そうしない場合そのプログラムは、ロケールや他 のプラットフォームでの動作の記述でぐちゃぐちゃになってしまうでしょう。 <tt>is_locale_utf8</tt> 関数は <htmlurl url="ftp://ftp.ilog.fr/pub/Users/haible/utf8/utf8locale.h" name="utf8locale.h"> で宣言され、<htmlurl url="ftp://ftp.ilog.fr/pub/Users/haible/utf8/utf8locale.c" name="utf8locale.c"> で定義されています。 <sect3> <!-- The libutf8 library --> libutf8 ライブラリ <p> <!-- A portable implementation of the ISO/ANSI C API, which supports 8-bit locales and UTF-8 locales, can be found in <htmlurl url="ftp://ftp.ilog.fr/pub/Users/haible/utf8/libutf8-0.6.2.tar.gz" name="libutf8-0.6.2.tar.gz">. --> ISO/ANSI C API の可搬性のある実装で、8 ビットのロケールと UTF-8 ロケール をサポートします。これは <htmlurl url="ftp://ftp.ilog.fr/pub/Users/haible/utf8/libutf8-0.6.2.tar.gz" name="libutf8-0.6.2.tar.gz"> より取得できます。 <!-- Advantages: --> 利点: <itemize> <item> <!-- Unicode UTF-8 support now, portably, even on OSes whose multibyte character support does not work or which don't have multibyte/wide character support at all. --> Unicode UTF-8 を可搬性のある形でサポートします。マルチバイト文字やワイド 文字をまったくサポートをしていない、もしくは正しく動作しない OS であって もです。 <item> <!-- The same binary works in all OS supported 8-bit locales and in UTF-8 locales. --> 8 ビットロケールおよび UTF-8 ロケールをサポートする全ての OS で 同一のバイナリを実行することができます。 <item> <!-- When an OS vendor adds proper multibyte character support, you can take advantage of it by simply recompiling without -DHAVE_LIBUTF8 compiler option. --> OS ベンダーが適切なマルチバイト文字サポートを追加すれば、 それを -DHAVE_LIBUTF8 コンパイルオプションなしで単純に再コンパイルするだ けで利用することができます。 </itemize> <sect3> <!-- The Plan9 way --> Plan9 の場合 <p> <!-- The Plan9 operating system, a variant of Unix, uses UTF-8 as character encoding in all applications. Its wide character type is called `<tt>Rune</tt>', not `<tt>wchar_t</tt>'. Parts of its libraries, written by Rob Pike and Howard Trickey, are available at <htmlurl url="ftp://ftp.cdrom.com/pub/netlib/research/9libs/9libs-1.0.tar.gz" name="ftp://ftp.cdrom.com/pub/netlib/research/9libs/9libs-1.0.tar.gz">. Another similar library, written by Alistair G. Crooks, is <htmlurl url="ftp://ftp.cdrom.com/pub/NetBSD/packages/distfiles/libutf-2.10.tar.gz" name="ftp://ftp.cdrom.com/pub/NetBSD/packages/distfiles/libutf-2.10.tar.gz">. In particular, each of these libraries contains an UTF-8 aware regular expression matcher. --> Unix の一種である Plan9 オペレーティングシステムは、全てのアプリケーションの 文字エンコーディングとして UTF-8 を使用しています。ワイド文字型は `<tt>wchar_t</tt>' ではなく、`<tt>Rune</tt>' です。Rob Pike と Howard Trickey が書いたライブラリは <htmlurl url="ftp://ftp.cdrom.com/pub/netlib/research/9libs/9libs-1.0.tar.gz" name="ftp://ftp.cdrom.com/pub/netlib/research/9libs/9libs-1.0.tar.gz"> にあります。Alistair G. Crooks の書いたその他の同様なライブラリは <htmlurl url="ftp://ftp.cdrom.com/pub/NetBSD/packages/distfiles/libutf-2.10.tar.gz" name="ftp://ftp.cdrom.com/pub/NetBSD/packages/distfiles/libutf-2.10.tar.gz"> です。これらのライブラリには UTF-8 を扱える正規表現があります。 <!-- Drawback of this API: --> この API の欠点: <itemize> <item> <!-- UTF-8 is compiled in, not optional. Programs compiled in this universe lose support for the 8-bit encodings which are still frequently used in Europe. --> UTF-8(サポート)はオプションではなく、コンパイル時に含まれてしまいます。 これによりプログラムは、ヨーロッパでまだ数多く使用されている 8 ビットエ ンコーディングをサポートできません。 </itemize> <sect2> <!-- For graphical user interface --> GUI 用には <p> <!-- The Qt-2.0 library <htmlurl url="http://www.troll.no/" name="http://www.troll.no/"> contains a fully-Unicode QString class. You can use the member functions QString::utf8 and QString::fromUtf8 to convert to/from UTF-8 encoded text. The QString::ascii and QString::latin1 member functions should not be used any more. --> Qt-2.0 ライブラリ <htmlurl url="http://www.troll.no/" name="http://www.troll.no/"> には、Unicode に完全対応した QString クラス があります。UTF-8 でエンコードされたテキストとの相互変換には、メンバ関数 の QString::utf8 および QString::fromUtf8 を使うことができます。 QString::ascii および QString::latin1 メンバ関数はもはや使うべきではありま せん。 <sect2> <!-- For advanced text handling --> 先進的なテキスト操作 <p> <!-- The previously mentioned libraries implement Unicode aware versions of the ASCII concepts. Here are libraries which deal with Unicode concepts, such as titlecase (a third letter case, different from uppercase and lowercase), distinction between punctuation and symbols, canonical decomposition, combining classes, canonical ordering and the like. --> これまでに述べたライブラリは、ASCII を扱えるものを Unicode を扱えるよう にしたバージョンです。ここで述べるのは titlecase(単語の始まりを大文字に すること、またはその反対)、句読点と記号の区別、標準的な分かち書き (decomposition)、結合を行うクラス、標準的なソートといった機能を Unicode で扱えるライブラリです。 <descrip> <tag>ucdata-2.3</tag> <!-- The ucdata library by Mark Leisher <htmlurl url="http://crl.nmsu.edu/~mleisher/ucdata.html" name="http://crl.nmsu.edu/~mleisher/ucdata.html"> deals with character properties, case conversion, decomposition, combining classes. --> Mark Leisher の ucdata library <htmlurl url="http://crl.nmsu.edu/~mleisher/ucdata.html" name="http://crl.nmsu.edu/~mleisher/ucdata.html"> には、文字のプロパティ、 大文字と小文字の変換、分かち書き(decomposition)、結合を行うクラスがあります。 <tag>ICU</tag> <!-- IBMs Classes for Unicode <htmlurl url="http://oss.software.ibm.com/developerworks/opensource/icu/" name="http://oss.software.ibm.com/developerworks/opensource/icu/">. A very comprehensive internationalization library featuring Unicode strings, resource bundles, number formatters, date/time formatters, message formatters, collation and more. Lots of supported locales. Portable to Unix and Win32, but compiles out of the box only on Linux libc6, not libc5. --> IBM の Unicode クラス(IBMs Classes for Unicode) <htmlurl url="http://www.alphaworks.ibm.com/tech/icu/" name="http://www.alphaworks.ibm.com/tech/icu/"> です。総合的な国際化ライ ブラリで、Unicode の文字列、リソースバンドル、数値のフォーマッタ、日付/ 時間のフォーマッタ、メッセージフォーマッタ、照合などの機能があります。多 くのロケールがサポートされており、Unix と Win32 の間で可搬性がありますが、 そのままでは Linux の libc6 上でしかコンパイルできません(libc5 では駄目です)。 <tag>libunicode</tag> <!-- The GNOME libunicode library <htmlurl url="http://cvs.gnome.org/lxr/source/libunicode/" name="http://cvs.gnome.org/lxr/source/libunicode/"> by Tom Tromey and others. It covers character set conversion, character properties, decomposition. --> Tom Tromey 達による、GNOME libunicode library <htmlurl url="http://cvs.gnome.org/lxr/source/libunicode/" name="http://cvs.gnome.org/lxr/source/libunicode/"> です。これには文字セッ トのコンバート、文字のプロパティ、分かち書き(decomposition)の機能があり ます。 </descrip> <sect2> <!-- For conversion --> 変換用には <p> <!-- Two kinds of conversion libraries, which support UTF-8 and a large number of 8-bit character sets, are available: --> 2 種類の変換ライブラリがあります。これは UTF-8 や、 多くの 8 ビット文字セットをサポートしています。 <sect3>iconv <p> <!-- The iconv implementation by Ulrich Drepper, contained in the GNU glibc-2.1.1. --> GNU glibc-2.1.1 に含まれている、Ulrich Drepper による iconv の実装 <htmlurl url="ftp://ftp.gnu.org/pub/gnu/glibc/glibc-2.1.1.tar.gz" name="ftp://ftp.gnu.org/pub/gnu/glibc/glibc-2.1.1.tar.gz"> <!-- The portable iconv implementation by Bruno Haible. --> Bruno Haible による可搬性のある iconv <htmlurl url="ftp://ftp.ilog.fr/pub/Users/haible/gnu/libiconv-1.1.tar.gz" name="ftp://ftp.ilog.fr/pub/Users/haible/gnu/libiconv-1.1.tar.gz"> <!-- The portable iconv implementation by Konstantin Chuguev. --> Konstantin Chuguev <htmlurl url="mailto:joy@urc.ac.ru" name="<joy@urc.ac.ru>"> による可搬性のある iconv <htmlurl url="ftp://ftp.urc.ac.ru/pub/local/OS/Unix/converters/iconv-0.4.tar.gz" name="ftp://ftp.urc.ac.ru/pub/local/OS/Unix/converters/iconv-0.4.tar.gz"> <!-- Advantages: --> 利点: <itemize> <item> <!-- iconv is POSIX standardized, programs using iconv to convert from/to UTF-8 will also run under Solaris. However, the names for the character sets differ between platforms. For example, "EUC-JP" under glibc is "eucJP" under HP-UX. (The official IANA name for this character set is "EUC-JP", so it's clearly a HP-UX deficiency.) --> iconv は POSIX 標準であり、iconv を使用して UTF-8 との相互変換を行うプロ グラムは Solaris でも動作します。ただし文字セットの名前はプラットフォー ム間で異なっています。例えば glibc では "EUC-JP" ですが、HP-UX では "eucJP" になっています(この文字セットの公式な IANA での名前は "EUC-JP" ですから、明らかに HP-UX が間違っています)。 <item> <!-- On glibc-2.1 systems, no additional library needed. On other systems, one of the two other iconv implementations can be used. --> glibc-2.1 では他にライブラリを必要としません。その他の環境では、Bruno Haible や Konstantin Chuguev の実装した iconv を使用することができます。 </itemize> <sect3>librecode <p> <!-- librecode by François Pinard --> François Pinard の librecode <htmlurl url="ftp://ftp.gnu.org/pub/gnu/recode/recode-3.5.tar.gz" name="ftp://ftp.gnu.org/pub/gnu/recode/recode-3.5.tar.gz"><!--.--> <!-- Advantages: --> 利点: <itemize> <item> <!-- Support for transliteration, i.e. conversion of non-ASCII characters to sequences of ASCII characters in order to preserve readability by humans, even when a lossless transformation is impossible. --> 字訳(transliteration)をサポートしています。これは非 ASCII 文字を ASCII 文字へと、欠落のない(lossless)変換が不可能な場合であっても人間が読める形 にコンバートします。 </itemize> <!-- Drawbacks: --> 欠点: <itemize> <item> <!-- Non-standard API. --> 標準外(non-standard) な API <item> <!-- Slow initialization. --> 初期化が遅い </itemize> <sect2> <!-- Other approaches --> その他のアプローチ <p> <descrip> <tag>libutf-8</tag> <!-- libutf-8 by G. Adam Stanislav <htmlurl url="mailto:adam@whizkidtech.net" name="<adam@whizkidtech.net>"> contains a few functions for on-the-fly conversion from/to UTF-8 encoded `FILE*' streams. --> G. Adam Stanislav <htmlurl url="mailto:adam@whizkidtech.net" name="<adam@whizkidtech.net>">の libutf-8 には UTF-8 エンコードさ れた `FILE*' ストリームとの相互変換を動的に行なういくつかの関数がありま す。 <htmlurl url="http://www.whizkidtech.net/i18n/libutf-8-1.0.tar.gz" name="http://www.whizkidtech.net/i18n/libutf-8-1.0.tar.gz"> <!-- Advantages: --> 利点: <itemize> <item> <!-- Very small. --> 非常に小さい </itemize> <!-- Drawbacks: --> 欠点: <itemize> <item> <!-- Non-standard API. --> 標準外(non-standard) な API <item> <!-- UTF-8 is compiled in, not optional. Programs compiled with this library lose support for the 8-bit encodings which are still frequently used in Europe. --> UTF-8 はオプションではなくコンパイル時に含まれてしまいます。これにより、 このライブラリとコンパイルされたプログラムは 8 ビットのエンコーディング をサポートしません。こういったプログラムはヨーロッパではまだ数多く使用さ れています。 <item> <!-- Installation is nontrivial: Makefile needs tweaking, not autoconfiguring. --> インストールは簡単ではありません。autoconfig されないため、Makefile をい じる必要があります。 </itemize> </descrip> <sect1>Java <p> <!-- Java has Unicode support built into the language. The type `char' denotes a Unicode character, and the `java.lang.String' class denotes a string built up from Unicode characters. --> Java は言語自体が Unicode をサポートします。`char' 型は Unicode 文字を表 し、また `java.lang.String' クラスは Unicode の文字列を扱えます。 <!-- Java can display any Unicode characters through its windowing system AWT, provided that 1. you set the Java system property "user.language" appropriately, 2. the /usr/lib/java/lib/font.properties.<it>language</it> font set definitions are appropriate, and 3. the fonts specified in that file are installed. For example, in order to display text containing japanese characters, you would install japanese fonts and run "java -Duser.language=ja ...". You can combine font sets: In order to display western european, greek and japanese characters simultaneously, you would create a combination of the files "font.properties" (covers ISO-8859-1), "font.properties.el" (covers ISO-8859-7) and "font.properties.ja" into a single file. ??This is untested?? --> Java はどんな Unicode 文字でも、自身のウィンドウシステム AWT を使用して 表示することができます。このために必要なことは、 1. Java のシステムプロパティ "user.language" を適切なものにセットする。 2. /usr/lib/java/lib/font.properties.<it>language</it> フォントセットの 定義を適切なものにセットする。 3. 上記で指定したフォントをインストールする。例えば日本語の文字 を含むテキストを表示するには、日本語のフォントをインストールし、"java - Duser.language=ja ..." で実行します。フォントセットを組み合わせることも できます:西ヨーロッパ、ギリシャ、日本語の文字を同時に表示するには、 "font.properties" (ISO-8859-1 をカバー)、"font.properties.el" (ISO-8859-7 をカバー)、"font.properties.ja" ファイルを組み合わせたものを 作成します。??This is untested?? <!-- The interfaces java.io.DataInput and java.io.DataOutput have methods called `readUTF' and `writeUTF' respectively. But note that they don't use UTF-8; they use a modified UTF-8 encoding: the NUL character is encoded as the two-byte sequence 0xC0 0x80 instead of 0x00, and a 0x00 byte is added at the end. Encoded this way, strings can contain NUL characters and nevertheless need not be prefixed with a length field - the C <string.h> functions like strlen() and strcpy() can be used to manipulate them. --> java.io.DataInput および java.io.DataOutput インターフェースにはそれぞれ、 `readUTF' や `writeUTF' というメソッドがありますが、これらは UTF-8 を使 用しないことに注意してください。これらは変更された UTF-8 を使用します: NUL 文字は 0x00 のかわりに 2 バイトの 0xC0 0x80 としてエンコードされ、末 尾に 0x00 バイトが追加されます。このようにエンコードされるため、文字列は フィールドの長さを持たなくとも、NUL 文字を含むことができます。C では <string.h> の strlen() や strcpy() といった関数でそのような NUL 文 字を含んだ文字列を扱うことができます。 <sect1>Lisp <p> <!-- The Common Lisp standard specifies two character types: `base-char' and `character'. It's up to the implementation to support Unicode or not. The language also specifies a keyword argument `:external-format' to `open', as the natural place to specify a character set or encoding. --> Common Lisp 標準では `base-char' と `character' の 2 種類の文字列型を定 義しています。Unicode をサポートするかどうかは実装に依存します。文字セッ トやエンコーディングを指定するためには、引数として `:external-format' を 指定し、`open' で定義します。 <!-- Among the free Common Lisp implementations, only CLISP <htmlurl url="http://clisp.cons.org/" name="http://clisp.cons.org/"> supports Unicode. You need a CLISP version from July 1999 or newer. <htmlurl url="ftp://clisp.cons.org/pub/lisp/clisp/source/clispsrc.tar.gz" name="ftp://clisp.cons.org/pub/lisp/clisp/source/clispsrc.tar.gz">. The types `base-char' and `character' are both equivalent to 16-bit Unicode. The encoding used for file or socket/pipe I/O can be specified through the `:external-format' argument. The encodings used for tty I/O and the default encoding for file/socket/pipe I/O are locale dependent. --> フリーの(訳注:無料ではなく、自由という意味です) Common Lisp の実装では、 CLISP <htmlurl url="http://clisp.cons.org/" name="http://clisp.cons.org/"> だけが Unicode をサポートしていますが、そ のためには CLISP の 1999年 7月以降のバージョン <htmlurl url="ftp://clisp.cons.org/pub/lisp/clisp/source/clispsrc.tar.gz" name="ftp://clisp.cons.org/pub/lisp/clisp/source/clispsrc.tar.gz"> が必 要となります。`base-char'型 および `character' 型はどちらも 16-bit Unicode と同等です。ファイル、ソケット、パイプの I/O に使用されるエンコーディン グは `:external-format' 引数で指定することができます。ファイル、ソケット、 パイプの I/O のデフォルトのエンコーディングおよび tty I/O に使用されたエン コーディングはロケールに依存しています。 <!-- Among the commercial Common Lisp implementations, only Eclipse <htmlurl url="http://www.elwood.com/eclipse/eclipse.htm" name="http://www.elwood.com/eclipse/eclipse.htm"> supports Unicode. See <htmlurl url="http://www.elwood.com/eclipse/char.htm" name="http://www.elwood.com/eclipse/char.htm">. The type `base-char' is equivalent to ISO-8859-1, and the type `character' contains all Unicode characters. The encoding used for file I/O can be specified through a combination of the `:element-type' and `:external-format' arguments to `open'. Limitations: Character attribute functions are locale dependent. Source and compiled source files cannot contain Unicode string literals. --> 商用の Common Lisp の実装では、Eclipse <htmlurl url="http://www.elwood.com/eclipse/eclipse.htm" name="http://www.elwood.com/eclipse/eclipse.htm"> だけが Unicode をサポー トします。<htmlurl url="http://www.elwood.com/eclipse/char.htm" name="http://www.elwood.com/eclipse/char.htm"> を参照してください。 `base-char' 型は ISO-8859-1 と同等であり、また `character' 型は全ての Unicode 文字を含むことができます。ファイルの I/O に使用されるエンコーディ ングの指定は `:element-type' および `:external-format' 引数で `open' を指 定することにより可能です。制限事項: 文字属性(character attribute attribute) 関数はロケールに依存しています。ソースおよびコンパイルされたソー スファイルは Unicode の文字列でのリテラルを扱うことができません。 <!-- The commercial Common Lisp implementation Allegro CL does not support Unicode yet, but Erik Naggum is working on it. --> 商用の Common Lisp の実装である Allegro CL はまだ Unicode をサポートしま せんが、Erik Naggum が現在作業中です。 <sect1>Ada95 <p> <!-- Ada95 was designed for Unicode support and the Ada95 standard library features special ISO 10646-1 data types Wide_Character and Wide_String, as well as numerous associated procedures and functions. The GNU Ada95 compiler (gnat-3.11 or newer) supports UTF-8 as the external encoding of wide characters. This allows you to use UTF-8 in both source code and application I/O. To activate it in the application, use "WCEM=8" in the FORM string when opening a file, and use compiler option "-gnatW8" if the source code is in UTF-8. See the GNAT and Ada95 reference manuals for details. --> Ada95 は Unicode をサポートするためにデザインされました。Ada95 の標準ラ イブラリの機能には、ISO 10646-1 のための特別なデータ型である Wide_Character および Wide_String があります。これらに関連する多数のプロシー ジャや関数も同様です。GNU Ada95 コンパイラ(gnat-3.11 以降)は UTF-8 をワ イド文字の外部エンコーディングとしてサポートします。これにより、UTF-8 を ソースコードとアプリケーションの I/O として使用することができます。アプ リケーションでも使用できるようにするにはファイルをオープンする時に FORM 文字列 に "WCEM=8" をセットし、またソースコードが UTF-8 ならコンパ イラオプション "-gnatW8" を使用します。詳しくは GNAT および Ada95 のリファ レンスマニュアルを参照してください。 <sect> <!-- Other sources of information --> 他の情報源 <p> <sect1> <!-- Mailing lists --> メーリングリスト <p> <!-- Broader audiences can be reached at the following mailing lists. --> 以下のメーリングリストには、多くの人がいます。 <!-- Note that where I write `at', you should write `@'. (Anti-spam device.) --> <!-- mailto: を使わないから、普通のアドレスにした --> <sect2>linux-utf8 <p> <!-- Address: <tt>linux-utf8</tt> at <tt>nl.linux.org</tt> --> アドレス: <tt>linux-utf8@nl.linux.org</tt> <!-- This mailing list is about internationalization with Unicode, and covers a broad range of topics from the keyboard driver to the X11 fonts. --> このメーリングリストは Unicode による国際化についてです。 キーボードドライバから X11 のフォントまで、 幅広いトピックについて話されています。 <!-- Archives are at --> アーカイブは <htmlurl url="http://mail.nl.linux.org/linux-utf8/" name="http://mail.nl.linux.org/linux-utf8/"><!--.--> にあります。 <!-- To subscribe, send a message to <tt>majordomo</tt> at <tt>nl.linux.org</tt> with the line "subscribe linux-utf8" in the body. --> 講読(subscribe)するには <tt>majordomo@nl.linux.org</tt> へ、 本文に "subscribe linux-utf8" と書いて送信します。 <sect2>li18nux <p> <!-- Address: <tt>linux-i18n</tt> at <tt>sun.com</tt> --> アドレス: <tt>linux-i18nsun.com</tt> <!-- This mailing list is focused on organizing internationalization work on Linux, and arranging meetings between people. --> このメーリングリストは Linux における国際化作業の組織編成や 会合の打ち合わせについてです。 <!-- To subscribe, fill in the form at http://www.li18nux.org/ and send it to <tt>linux-i18n-request</tt> at <tt>sun.com</tt>. --> 講読(subscribe)するには http://www.li18nux.org/ でフォームに記述して <tt>linux-i18n-request@sun.com</tt> へ送信します。 <sect2>unicode <p> <!-- Address: <tt>unicode</tt> at <tt>unicode.org</tt> --> アドレス: <tt>unicode@unicode.org</tt> <!-- This mailing list is focused on the standardization and continuing development of the Unicode standard, and related technologies, such as Bidi and sorting algorithms. --> このメーリングリストは Unicode の標準化、開発、Bidi やソートのアルゴリズムといった関連する技術について話されています。 <!-- Archives are at --> アーカイブは <htmlurl url="ftp://ftp.unicode.org/Public/MailArchive/" name="ftp://ftp.unicode.org/Public/MailArchive/"><!--,--> <!-- but they are not regularly updated. --> にありますが、定期的にアップデートはされてはいません。 <!-- For subscription information, see --> 講読するには <htmlurl url="http://www.unicode.org/unicode/consortium/distlist.html" name="http://www.unicode.org/unicode/consortium/distlist.html"><!--.--> を御覧ください。 <sect2> <!-- X11 internationalization --> X11 国際化 <p> <!-- Address: <tt>i18n</tt> at <tt>xfree86.org</tt> --> アドレス: <tt>i18n@xfree86.org</tt> <!-- This mailing list addresses the people who work on better internationalization of the X11/XFree86 system. --> このメーリングリストは、X11/XFree86 システムの国際化の作業者向けのもので す。 <!-- Archives are at --> アーカイブは <htmlurl url="http://devel.xfree86.org/archives/i18n/" name="http://devel.xfree86.org/archives/i18n/"><!--.--> にあります。 <!-- To subscribe, send mail to the friendly person at <tt>i18n-request</tt> at <tt>xfree86.org</tt> explaining your motivation. --> 講読するには、<tt>i18n-request@xfree86.org</tt> (恐い人じゃないです) に メールして、動機を説明してください。 <sect2> <!-- X11 fonts --> X11 フォント <p> <!-- Address: <tt>fonts</tt> at <tt>xfree86.org</tt> --> アドレス: <tt>fonts@xfree86.org</tt> <!-- This mailing list addresses the people who work on Unicode fonts and the font subsystem for the X11/XFree86 system. --> このメーリングリストは Unicode フォントや、X11/XFree86 システム用のフォ ントサブシステムの開発者向けのものです。 <!-- Archives are at --> アーカイブは <htmlurl url="http://devel.xfree86.org/archives/fonts/" name="http://devel.xfree86.org/archives/fonts/"><!--.--> にあります。 <!-- To subscribe, send mail to the overworked person at <tt>fonts-request</tt> at <tt>xfree86.org</tt> explaining your motivation. --> 講読するには <tt>fonts-request@xfree86.org</tt> にいるオーバーワークの人 にメールして、動機を説明しましょう。 </article>