Re: gsf api thoughts
- From: Michael Meeks <michael ximian com>
- To: Jody Goldberg <jody gnome org>
- Cc: Zbigniew Chyla <cyba gnome pl>, gnome-office-list gnome org, abiword-dev abisource com, gnumeric-list gnome org
- Subject: Re: gsf api thoughts
- Date: 05 Aug 2002 14:20:50 +0100
Hi Jody,
On Fri, 2002-08-02 at 14:29, Jody Goldberg wrote:
+ for (; ptr < end ; ptr = g_utf8_next_char (ptr))
This is pretty much an abomination;
I'd like the gets methods to offer a guarantee that the content
coming back is valid.
Then do this at the end:
if (!g_utf8_validate (str, end-str, NULL))
... foo not valid ...
Iterating over utf8 chars like that is grim. For anyone not
understanding why, the man page 'man utf-8' is extremely instructive.
Having said all that, I think there is great in having a 'get_utf8' and
a 'get_mess' distinction; that is if it's not going to be possible to
detect / convert to utf-8 cleanly at the bottom of the pile.
Admitedly there is a potential to merge the
various gets methods into one, and set an 'encoding' flag on the
stream. I have no strong preferences.
If you're passing an encoding; it'd be better to always return utf-8
and the encoding be what is used to convert from 'random 8bit' to clean
utf-8.
Then again, perhaps I'm smoking crack,
Regards,
Michael.
--
mmeeks gnu org <><, Pseudo Engineer, itinerant idiot
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]