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

Re: emacs-w3m and w3mmee problems



>> On Sun, 15 Jun 2003 19:17:06 +0900
>> tsuchiya@pine.kuee.kyoto-u.ac.jp (TSUCHIYA Masatoshi) said as follows:

>> - http://www.emacswiki.org/cgi-bin/emacs-fr.pl is correctly
>>displayed using utf-8 but i can't follow the links because the url
>>is not encoded. (If you give me some clue on how url is encoded I
>>might help to find a solution).

>Could you try the attached patch?

この問題なんですが,結構,難問なので悩んでいます.

問題となっているのは,URI を相手サーバーに渡すときに,URI に non-ASCII
character が含まれていた場合にどうすればいいのか,ということです.例え
ば,日本語環境では,

    http://xxx/日本語のファイル名.txt

というような URI にアクセスするには,どのように URI を encode して送れ
ばいいでしょうか.

RFC2396 は,

   A URI scheme may define a mapping from URI characters to octets;
   whether this is done depends on the scheme.
   (snip)
   For original character sequences that contain non-ASCII characters,
   however, the situation is more difficult. Internet protocols that
   transmit octet sequences intended to represent character sequences
   are expected to provide some way of identifying the charset used, if
   there might be more than one [RFC2277].  However, there is currently
   no provision within the generic URI syntax to accomplish this
   identification. An individual URI scheme may require a single
   charset, define a default charset, or provide a way to indicate the
   charset used.

と言っているので,現時点では確立した規約は存在しないと思います.

では,現時点ではどのようにすべきでしょうか.

(1) URI を,表示中のページの encoding に従って encode して得られる 
    octet 列をそのままサーバーに渡す.
(2) URI を,表示中のページの encoding に従って encode して得られる 
    octet 列を,%-escape してサーバーに渡す.[emacs-w3m:05153] のパッ
    チは,この方法.

mod_encoding や,Windows 環境での HTTP server の実装はどうなっているか,
ご存じの方は教えていただけないでしょうか.よろしくお願いします.

-- 
土屋 雅稔 ( TSUCHIYA Masatoshi )