namazu-dev(ring)


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

mail from the author of xpdf



mimasa氏に Cc: します。(助言が欲しい)

次のようなメイルが届きました。今日は試験勉強をしないといけな
いので返事は明日以降に出します。

Message-Id: <199906020645.XAA05516@xxxxxxxxxxxxxxxxxxx>
Subject: Namazu - PDF interface
From: "Derek B. Noonburg" <derekn@xxxxxxxxxxx>
Date: Tue, 1 Jun 1999 23:46:13 -0700 (PDT)
| 
| I received email from Arumugam-san asking about using your Namazu search
| software to index and search PDF files.  I'm the author of xpdf, which
| includes a program called pdftotext that extracts the text from PDF
| files.  Currently, xpdf can display Japanese text, but pdftotext cannot
| extract it (pdftotext only handles 8-bit fonts).
| 
| It should not be too hard for me to add support for Japanese text to
| pdftotext.  One thing I need to know is: what encoding does Namazu use
| for Japanese text?  PDF files use Adobe Japan1-2 (and variations)
| internally.  I already have a mapping from Japan1-2 to JIS X 0208-1983.
| Is this useful?  Also, is there some way of distinguishing 8-bit and
| 16-bit characters in the same text file?
| 
| Thanks.
| 
| - Derek


返事としては

| internally.  I already have a mapping from Japan1-2 to JIS X 0208-1983.
| Is this useful?  Also, is there some way of distinguishing 8-bit and
| 16-bit characters in the same text file?

はい、たいへん useful です。 8 bit と 16 bit のコードを区別
するには、単純に 16 bit のコード (JIS X 0208-1983) の 1
octet 毎 (8 bit毎) に MSB を 1 に設定すればよいです。(ただし、 
8 bit のコードはすべて MSB が 0 であるとする - たとえば 
ASCIIコード)。これは EUC-JP と呼ばれる encoding です。

  (例を示す)

他にも Shift_JIS や ISO-2022-JP といった encoding 法がありま
すが、これらは処理が面倒です。 EUC-JP をお勧めします。

…といった内容でよろしいでしょうか? (ISO-2022-JPを勧めた方が
よいのかな?) 厳密には JIS X 0201 カナの扱いや補助漢字につい
ても説明すべきなんでしょうけど、私にはちょっとそこまではでき
ません。この辺の知識について英語で書かれた正確な文書はないで
しょうか?

もちろん、書籍なら

  * CJKV Information Processing : Chinese, Japanese, Korean & Vietnamese
    <http://www.oreilly.com/catalog/cjkvinfo/noframes.html>

があるわけですが。 (読んでいないけど)

あるいはどなたか適切な返答を考えてもらえると助かります。:)

-- Satoru Takabayashi