On Sat, 2009-03-14 at 12:48 -0700, Krzysztof KosiĆski wrote:
That's funny, I remember that the person who wrote the streams complained that GIO is broken because it doesn't handle UTF-8 natively, only byte streams.
The real in-depth solution would be to migrate to GIO streams everywhere, and code custom streams for things that we need. However, some of our devs don't have Glib 2.16 yet. Another issue is that the streams would have to be in plain GObject or use our custom bindings, because the existing C++ bindings don't expose the virtual functions (giomm devs thought that nobody would want to use them - actual answer from http://bugzilla.gnome.org/show_bug.cgi?id=572471).
A more short-term solution is of course fixing the existing streams.
No, actually moving to GIO does nothing to address this specific problem. It does solve other issues, but nothing on character vs. byte issues.
Traditionally C and C++ programmers are very poor in handling character vs. byte issues, since among other things the "byte" type is named "char", etc. However Java programmers have to deal with this, as Java strings are all actually "character", which is the equivalent of 16-bit Unicode and any non-trivial file or network handling has to address the conversions properly.
The existing stream implementation there does have "OutputStream" and "Writer" type classes. We really don't want to throw the baby out with the bathwather and start over, especially since we are close to a good implementation. All we really need to do is properly handle stream vs. writer and all will be fixed. Even if we switched to something GIO based we would have to recreate all that and then do the same work on top of the new.