Le Wednesday 01 October 2008 04:06:25 [EMAIL PROTECTED], vous avez écrit : > b = gtk.Button(u"\u0000/hello/world") > > which emits this message: > TypeError: OGtkButton.__init__() argument 1 must be string without > null bytes or None, not unicode > > SQLite has a similar problem with NULLs, and I'm definitely sticking > paths in there, too.
I think that you can say "all C libraries". Would it possible to convert the encoded string to bytes just before call Gtk? (job done by some Python internals, not as an explicit conversion) I don't know if it would help the discussion, but Java uses its own modified UTF-8 encoding: * NUL byte is encoded as 0xc0 0x80 instead of 0x00 * Java doesn't support unicode > 0xFFFF (bouuuuh!) http://java.sun.com/javase/6/docs/api/java/io/DataInput.html#modified-utf-8 -- Victor Stinner aka haypo http://www.haypocalc.com/blog/ _______________________________________________ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com