Re: [Inkscape-devel] non-ASCII chars

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; }
is this enough sanitizing? :)
_________________________________________________________________ Protect your PC - get McAfee.com VirusScan Online http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963

On Tue, 2003-12-09 at 02:13, bulia byak 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; }
is this enough sanitizing? :)
Looks adequately paranoid ^_^
-mental

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...
participants (3)
-
Amardeep Singh
-
bulia byak
-
MenTaLguY