Re: IOChannel and dodgy encodings



On Wed, Aug 01, 2001 at 10:47:24PM -0700, Ron Steinke wrote:
> If you're getting data which is not in a definite encoding, use
> g_io_channel_set_encoding() to set the encoding to NULL. This
> is binary safe, and doesn't do any conversion or UTF-8 validation.

	At which point, I need to do the validation myself before
inserting it into the GtkTextView, right?  I assume that I validate my
little buffer, and then go on.  If validation fails, I do some work to
figure why.

> More sophisticated error handling is somewhat in flux. I've considered
> only returning G_CONVERT_ERROR_ILLEGAL_SEQUENCE if the bad character is
> first in the buffer. This would allow you do a seek with G_SEEK_CUR
> to avoid the character, as the buffer which interferes with G_SEEK_CUR
> in some encodings would be empty. The current implementation doesn't
> do this, however. If you would be interested in such a thing, please
> forward your reply to gtk-devel-list gnome org with comments.

	This may be interesting, but I do not know that it would do
everything.  In my error case, I'm pretty sure that it is in the middle
of the buffer somewheres.

Joel

-- 

"Time is an illusion, lunchtime doubly so."
        -Douglas Adams

			http://www.jlbec.org/
			jlbec evilplan org




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