10 Dec
2003
10 Dec
'03
6:53 a.m.
On 9 Dec 2003, archiver_1@...19... wrote:
So... it's often good to do 'sanitizing' of input. In this case, where it's direct user input, speed should not even be a problem.
OK, what about:
u = g_utf8_get_char (utf8); if (u == (gunichar) -1) { g_warning ("Bad UTF-8 character"); return pos; } if (!g_unichar_isprint (u)) { g_warning ("Non-printable character"); return pos; }
what about just using g_utf8_validate() (or g_utf_get_char_validated())
http://developer.gnome.org/doc/API/2.0/glib/glib-Unicode-Manipulation.html#g...