Le Wednesday 01 October 2008 04:06:25 glyph at divmod.com, 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/
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4