Re: g_convert and g_utf8_validate



	(Assuming that no other unicode utility functions are already
planned:)

	What is the purpose of g_utf8_validate?  Just to check for invalid
input before passing to g_convert?

	With these two functions, the app programmer would always want to
call g_utf8_validate on an input stream, followed by g_convert-- and then
if the number of bytes_converted is zero (and the input stream is not
zero-length), we know that the particular charset is unsupported on this
system?

	Sounds like a lot of work just to find out whether or not a
particular charset is supported.

	I would suggest two things:

1) Add 

gboolean g_charset_is_supported(gchar *charset)

	...to let the programmer see whether or not a particular charset
is supported (before attempting a g_convert on it).  It should return TRUE
only if the conversion both to and from that charset is supported by
g_convert.

2) If you're going to provide g_utf8_validate, also provide
g_utf16_validate for completeness.



Thanks,
Derek Simkowiak
dereks@kd-dev.com






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