Re: next problem with g_io_channel_read_to_end(), again



Hi,

Axel <axel azerty netcourrier com> writes:

> thx all for your advice, read channel works well
> but, I have a problem
> here is the error I get when I try to read a file with accentued
> characters like é è à and so...
> 
> ** ERROR **: Invalid byte sequence in conversion input
> aborting...
> Aborted
> 
> 
> strings are handled as UTF-8, should be due to that?
> Could someone give me url or advice on other charset handling?

the docs clearly state:

"The default encoding for GIOChannel is UTF-8."

If you read binary data, you should set the encoding to NULL. For text
files with other encodings, you need to know their encoding since if
you want to display the text in GTK+, you need to convert it to UTF-8.
GLib has all the functions you need to do that and they are all well
documented.


Salut, Sven



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