Le lun, mai 28, 2001, à 09:07:01 +0800, James Henstridge a écrit:
> > Any loud screams ?
>
> Nope. We should also look at switching the internal encoding in .dia
> files to utf8. This will be needed when we switch over to gtk+ 2.0 and
> libxml2 (even though you can compile dia with libxml2 at the moment, you
> get corruption if you use any 8 bit characters in your diagrams). Note
> that this is not really an issue for the windows port, as it already uses
> utf8 internally; this should make diagrams with 8 bit characters portable
> between windows and unix machines however.
Normally, XML files already embed character set encoding information in the
very first element (<?xml version="1.0" encoding="foo"?>
Is (libxml1 8-bit only) and (libxml2 dependent on gtk2) ? If not, we
probably could move dia's internals to utf8, keeping a charconv_utf8_to_local8 call
just before render_gdk.c/draw_string() (assuming #54628 is in fact fixed or
someone understands how to really fix it).
However, this will be no small task (basically requires to audit the whole
code for (gchar *) arithmetic and moving that to the unicode_* functions,
and define wrappers for these when !HAVE_UNICODE). I'm very motivated to
tackle this, but I'd like 0.88.1 to not be the new 0.86. I think there has
been enough problems removed in the CVS head relative to 0.88.1, that making
a new release (either 0.88.3 or 0.89) before going utf8 actually makes sense.
> Getting the locale's charset doesn't look that trivial. There is a
> function that does this in HEAD glib (g_utf8_get_charset_internal in
> gutf8.c). Once we have code to get the charset, it is just a matter of
> adding the appropriate iconv calls in lib/dia_xml.c
Well, you've seen that in fact, it's not that difficult <grin/>. Just use
the interface from lib/charconv.h, and let that code worry about how it's
going to be done (I'd really like charconv.c to use the native calls under
Win32, but I don't remember their names. OTOH, if win32-gtk effectively has
HAVE_UNICODE defined, it's not a problem. Hans ?)
-- Cyrille
--
Grumpf.