GIOChannel missing binary mode?



Hi,

while porting GIMP <-> plug-in communication to
g_io_channel_[read|write]_chars() i noticed that there
are two GIOChannel attributes, "do_encode" and "encoding".

My impression from looking at the code is that if
"do_encode" == FALSE, "encoding" is assumed to be UTF-8.

So either I missed something or there seems to be no way
to use a GIOChannel in binary mode, because if I say
g_io_channel_set_encoding (channel, NULL, NULL),
"do_encoding" is set to FALSE automatically.

A subsequent call to read_chars() or write_chars() however
looks at "do_encode", assumes UTF-8 if it is FALSE and
calls g_utf8_validate() which of course fails on binary
data.

Please point me to the right direction if I made a mistake :-)

(FYI: right now, as a workaround, i use channel->funcs->io_foo())

ciao,
--Mitch




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