Re: g_locale_from_utf8 and minus sign



On Sun, 2008-12-28 at 16:17 -0500, Allin Cottrell wrote:
> When my app displays numerical output, I've been using a "real"
> minus sign (U+2212) if the current font supports this (as checked
> by pango), since it looks better than the usual hyphen-as-minus.
> 
> The minus sign displays correctly within GTK, but I've noticed
> that if the app is running on, e.g. an ISO-8859-1 platform, so
> that output has to be recoded for saving to disk or copying to the
> clipboard, g_locale_from_utf8 chokes on the minus sign, giving
> 
> "Invalid byte sequence in conversion input"
> 
> I'm not sure if this is exactly a bug, but shouldn't U+2212 get
> successfully mapped onto character 45 (0x002D) in ISO-8859-1?

You should use g_filename_from_utf8() to convert to filenames.

This is an application development question though, and you should use
the gtk-app-devel-list.

Cheers



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