Re: g_convert and g_utf8_validate



-> > 	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().

	Yes, that was obvious.  I guess I meant to say "...check for
invalid UTF-8 input before passing UTF-8 input to g_convert".

	I was thinking g_utf8_validate was a response to the fact that
g_convert won't tell you the difference between a failed conversion due to
invalid input, vs. a failed conversion due to an unsupported character
set.

	But since it's not, I still see the need for a 
g_charset_is_supported()-like function.


-> We aren't trying to be complete. We are UTF8 bigots. You have to use
-> iconv() or g_convert() to use funky charsets.

	Since g_convert won't tell you whether or not the input is valid
(or if the desired charset is just unsupported), g_convert is not a
substitute for g_<some charset>_validate().  But your answer still defends
not having a g_utf16_validate :).


--Derek





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]