Re: Natilus using UTF-8 for filenames regardless of locale

gabor farkas wrote:
> On Sun, 2004-07-18 at 01:59, DANIELLLANO wrote:
> > gabor wrote:
> > > the guessing is usually something like this:
> > > the application assumes that the filename is utf8. he begins to read it.
> > > but then he founds out that it's not valid utf8. then he uses something else (
> > > usually iso-8859-1 or locale-defined one).
> > 
> > Could someone point me where the code that does that is?
> > I'm looking into implementing the same code in another gnome
> > application.
> i do not know how glib handles this, but imho it's simply:
> byte[] b = readBytes();
> string t = decodeBytes(b,"UTF-8");
> if (t == null) //or any other way that signalizes that the decoding
> failed
> then t = decodeBytes(b,"ISO-8859-1"); //this will not fail because all
> byte streams are valid iso-8859-1 strings.

I don't need java conceptual code. You already explained the algorithm
in words. I'm asking for the exact same code or functions to show to
some people how this is exactly handled in nautilus and try to make a
patch to that application (in c)
I just need the exact reference to that code.
Is that handled in glib as you suggested?
Because I couldn't find the code in nautilus.

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