[JDEV] about encoding
Daniel Veillard
veillard at redhat.com
Fri Mar 9 02:23:59 CST 2001
On Fri, Mar 09, 2001 at 11:39:52AM -0800, Jau-Lung Huang wrote:
> > Practically encoding all the session in UTF8 is what makes the most sense,
> > you don't have to infringe the XML specification, you stay within reasonable
> > bounds, all parsers are supposed to handle UTF8 and this doesn't add an
> > extra penalty for all the protocol related messages like UTF16, and ensure
> > cheaper processing on the servers (not to be neglected !).
> Hi...
>
> Thanks your detail explanation to let me learn much
> But I think that you missunderstand my problem ;)
> now I use utf8 to encoding the big5 chinese message in xml stream.
> like this:
>
> send out encoding
> big5 message -> utf-8 encoding -> format to xml
>
> get in decoding
> xml -> utf-8 decoding -> big5 message
>
> this way work fine
> but i think whether i can express what the original native encoding is
> before doing utf-8 encoding process in xml.
>
> like example above , is there any way to express that its original
> encoding is BIG5
Oh sure, there is even examples in the XML spec, use xml:lang
Well actually it won't tell you what *encoding* is used but what
*language* is used, which is actually the more fundamental
point, from it you can derive the character set and encoding to use:
http://www.w3.org/TR/REC-xml#sec-lang-tag
2.12 Language Identification
BTW it may be useful (if not there already) to allow it in the DtD
for the message construct, xml:lang is not 'magic' and must be declared
#IMPLIED to use it without breaking validation.
> I ever think that use unicode to solve the multilingual problem
> But I found that some environment still didn't support unicode.
Well, the framework does,
> so I hope find a way to express the message's original encoding to mix
> the usage of unicode and other native language encoding.
Okay, but please stay within bounds of legal XML,
Daniel
--
Daniel Veillard | Red Hat Network http://redhat.com/products/network/
veillard at redhat.com | libxml Gnome XML XSLT toolkit http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
More information about the JDev
mailing list