Re: question about encoding



Hi,

Axel <axel azerty netcourrier com> writes:

> 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.

you need to know it beforehand. No application can interpret a text
file without knowledge about the character encoding. That's why every
sane file format that includes text, defines the encoding or defines
how the encoding is specified.

There are some reasonable heuristics that can be used to guess
encodings but that is outside the realm of GLib. In your case, I'd
guess your file is ISO-8859-1 encoded.


Salut, Sven



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