Re: g_convert and g_utf8_validate
- From: Havoc Pennington <hp redhat com>
- To: Derek Simkowiak <dereks kd-dev com>
- Cc: gtk-devel-list gnome org
- Subject: Re: g_convert and g_utf8_validate
- Date: 11 Jul 2000 15:22:02 -0400
Derek Simkowiak <dereks@kd-dev.com> writes:
> What is the purpose of g_utf8_validate? Just to check for invalid
> input before passing to g_convert?
>
g_utf8_validate() assumes the encoding is UTF8. It doesn't work on
anything you'd normally pass to g_convert().
The purpose of this is to ensure you have valid UTF8, for example when
loading a file you expect to be UTF8, or in g_return_if_fail()
statements. If you pass invalid UTF8 to GTK, GTK will probably crash
sooner or later.
> 2) If you're going to provide g_utf8_validate, also provide
> g_utf16_validate for completeness.
>
We aren't trying to be complete. We are UTF8 bigots. You have to use
iconv() or g_convert() to use funky charsets.
Havoc
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]