28 Nov 23:53
Bogus treatment of numeric HTML entities
From: Hrvoje Niksic <hniksic <at> xemacs.org>
Subject: Bogus treatment of numeric HTML entities
Newsgroups: gmane.emacs.w3.devel
Date: 2003-11-28 22:55:39 GMT
Subject: Bogus treatment of numeric HTML entities
Newsgroups: gmane.emacs.w3.devel
Date: 2003-11-28 22:55:39 GMT
Take this chunk of HTML:
<pre>
;; Emacs の バッファでの face 情報を読み取って、その字体(太字・
;; 斜体)・色を反映した HTML を出力するプログラムです。
</pre>
Mozilla displays it correctly, provided it has the necessary fonts at
its disposal. On the other hand, the W3 currently shipped with XEmacs
chokes with "Wrong type argument: char-or-string-p, 12398". A little
investigation of how W3 treats entities shows the cause of the
problem:
(let ((repl (cdr-safe (assq w3-p-s-num w3-invalid-sgml-char-replacement))))
(insert (or repl (mule-make-iso-character w3-p-s-num)))))
In other words, W3 takes the numeric entity and expects
`mule-make-iso-character' to convert it to a character. I don't know
what `mule-make-iso-character' is supposed to do because it's
undocumented. But under XEmacs, it simply returns CHAR (a number!)
unchanged. Since 12398 does not correspond to the code of any Mule
character, an error is signaled.
The above code snippet is preceded by a comment:
;; char-to-string will hopefully do something useful with characters
;; larger than 255. I think in MULE it does. Is this true?
;; Bill wants to call w3-resolve-numeric-entity here, but I think
;; that functionality belongs in char-to-string.
;; The largest valid character in the I18N version of HTML is 65533.
(Continue reading)
RSS Feed