Re: question about encoding



Hello,

On Fri, 2003-03-28 at 06:41, Axel wrote:
> hi
> I m trying to open and read file which contains accentued characters 
> like יטשא
> so
> I open a file, with GIOChannel and read the strings
> but what is the function to get the encoding ?
> I didn' t found it in API
> I have seen call to convert to utf8 but it needs the original encoding 
> from the string, and I didn' t found how to get it.
> Someone could help me ?

I don't think that GIOChannel has anything to do with the encoding
of a string in a file.

To GIOChannel, you are dealing with a file.  It really doesn't
care what's in it.  It's just a bunch of bytes to it.

To know what kind strings you are reading from the file.  (Or even
to know that there are even strings in the file.)  You'll have
to know something about the type of file you are dealing with.

For example, you could be dealing with a MPEG file, a JPEG file,
a PNG file, an Intel 80386 native DLL, a UNICODE text file encoded
in UTF-16, an XML file, a GNU tar archive, etc.

What you probably first need is a way to figure out what type of
file you are dealing with.

And, if you already know that, then you'll probably need a way
to figure out what the data in the file is.  (This is file
dependent though.  GIOChannel is at a much lower level that
this... so it wouldn't provide an API for this kind of thing.)

Hope that helps.


See ya

-- 
     Charles Iliya Krempeaux, BSc
     charles reptile ca

________________________________________________________________________
 Reptile Consulting & Services    604-REPTILE    http://www.reptile.ca/



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