Tony Mechelynck wrote:

> Here is an alternative way to handle it, which may be "the right way"
> from a conceptual point of view, and in the long term, though it may
> be much more difficult from the coding point of view. It may or may
> not be "the right thing to do" pragmatically:
> 
> Treat GB18030 as what it is, namely, a Unicode Transformation Format.
> In other words, whenever 'encoding' is set to GB18030, use UTF-8
> internally and convert when reading and writing, just like we already
> do for UTF-16le, UTF-16be, UTF-32le and UTF-32be.
> 
> This, of course, also suffers from the performance problems related to 
> conversion GB18030 <=> UTF-8.

Converting various Unicode encodings to and from UTF-8 is trivial.
Conversion between GB18030 and UTF-8 requires iconv.  This is a huge
difference.  Also because the conversion may fail.

If we go this way it's probably better not to use tricks and explicitly
set 'encoding' to utf-8.  One would need to try this out to discover any
problems, e.g. with menus.  Try Motif: GTK is utf-8 based thus Motif is
more of a challange.

-- 
Spam seems to be something useful to novices.  Later you realize that
it's a bunch of indigestable junk that only clogs your system.
Applies to both the food and the e-mail!

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\        download, build and distribute -- http://www.A-A-P.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

Reply via email to