Re: Proper handling of unicode strings

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

 



That's great - simplifies a lot of things. But since one character might
need more space than a gchar is it save to call strlen on that string?

Thanks

Milosz Derezynski wrote:
> Yes an UTF-8 string a NULL-terminated ASCII-compatible string. For all
> purposes except where you need to read it character-by-character (e.g.
> Gtk+/Pango "reading" the string to display it), you can just treat it
> like a normal ASCII string.
> 
> 2008/7/6 LCID Fire <lcid-fire@xxxxxxx <mailto:lcid-fire@xxxxxxx>>:
> 
>     I'm currently in the process of writing an application which needs to
>     support unicode - but I'm still a little confused of how to properly
>     handle it. Maybe someone can help me out here.
> 
>     First of is it valid for e.g. utf8 strings to assume they are NULL
>     terminated? Would it be valid to call g_strdup on a utf8 string?
> 
>     If not (and this is done quite often in the unicode glib part) I assume
>     I have to add the byte length of a string, right (which will bloat
>     function declarations)?
_______________________________________________
gtk-list mailing list
gtk-list@xxxxxxxxx
http://mail.gnome.org/mailman/listinfo/gtk-list

[Index of Archives]     [Touch Screen Library]     [GIMP Users]     [Gnome]     [KDE]     [Yosemite News]     [Steve's Art]

  Powered by Linux