Re: g_locale_from_utf8 and minus sign



On Mon, 29 Dec 2008, Behdad Esfahbod wrote:

> Matthias Clasen wrote:
> > On Mon, Dec 29, 2008 at 2:57 PM, Allin Cottrell <cottrell wfu edu> wrote:
> >
> >> I judged it a devel issue because it raised a question about
> >> whether glib was doing the right thing in not converting U+2212 to
> >> "the nearest" character in ISO-8859-1, 0x2D.  However, I accept an
> >> offlist response from Dom Lachowicz, namely that these are
> >> different characters and so glib is right not to convert.
> >
> > This is really a question about iconv behaviour, since glib doesn't do
> > its own conversion. And I guess when you as the iconv developers about
> > this, they
> > will tell you that iconv is not about guessing the 'nearest'
> > character, but rather
> > about recoding characters from one coded character set to another. A
> > hyphen is not the same character as a minus, thus iconv won't recode
> > the latter to the former, even if they look similar on paper. I agree
> > that it would be more useful
> > if iconv _would_ do what you expected it to do...
>
> The glibc implementation of iconv actually does that if you nicely ask it to:
>
> $ echo − | iconv -f utf8 -t latin1
> iconv: illegal input sequence at position 0
> $ echo − | iconv -f utf8 -t latin1//translit
> -
>
> Should glib try the //translit version first?  I think so.  That's what I made
> vte do, and filed this bug about it:
>
>   http://bugzilla.gnome.org/show_bug.cgi?id=502951

Sounds like a good idea.  But I notice there has been no progress
on that bug since over a year ago.  Might it do better as a
feature request, if there is such a thing?  (Simply on the grounds
that calling for the default behavior of iconv is unlikely to be
considered a bug, even if one could do better with a different
call.)

Allin Cottrell



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