More-than-ASCII chars
[email protected] Fri, 17 Oct 2003 11:15:01 -0700 (PDT)
| Newsgroups | gmane.lisp.scheme.ssax-sxml |
|---|---|
| Message-ID | <[email protected]> |
MJ Ray wrote: > I recently ran into the problem with the PLT Scheme edition's > ssax:xml->sxml hitting a UTF-8 numeric ᤓ IMO, the real bug is > that PLT's integer->char doesn't handle anything over 255, but could > that sort of entity be handled in another way? The current version of SSAX (tagged in the repository with the RELEASE_4A_PT tag) no longer uses integer->char or other similar functions. Instead, SSAX relies on the functions provided in a module char-encoding.scm. In particular, functions ascii->char and ucscode->char. The char-encoding.scm module is of course platform specific, unfortunately. Each platform should provide its own implementation of these functions. Scheme48 has a native ascii->char; Bigloo has ucs2->char. I think Gauche has something similar too. Any Java/JVM-based Scheme system should have no problem with implementing these functions. However, until we have a character set SRFI, char-encoding.scm will remain platform-specific. Perhaps some of the readers of this list would like to take upon that SRFI? Actually, SSAX makes one more implicit assumption, that Scheme's char-alphabetic? function will return #t for all characters that the XML Recommendation says are alphabetic. char-alphabetic? will for sure return #t for any alphabetic ASCII character. If char-alphabetic? supports other encodings, and if that predicate can correctly distinguish an alphabetic character from a punctuation in these encodings is unclear. Perhaps on some systems that handle Unicode/UCS2 char-alphabetic? can do all that. If it can, SSAX can handle XML documents where _tag_ names themselves (not the character content!) are written in Greek, in Kana, or Kanji. Indeed, according to the XML Recommendation, all Kanji are considered letters and may appear wherever an ASCII letter is allowed. ------------------------------------------------------- This SF.net email sponsored by: Enterprise Linux Forum Conference & Expo The Event For Linux Datacenter Solutions & Strategies in The Enterprise Linux in the Boardroom; in the Front Office; & in the Server Room http://www.enterpriselinuxforum.com