Re: [cx-oracle-users] Antw: Bad conversion of a unicode value?
Brought to you by:
atuining
From: Amaury F. d'A. <ama...@gm...> - 2007-11-28 16:32:08
|
matilda matilda wrote: > >>> Michael Schlenker <ms...@co...> 28.11.2007 16:31 >>> > >Michael Schlenker schrieb: > > Okay, i got my test to work after patching cx_Oracle a little bit. > > Anthony will be happy to hear that. ;-) Anthony: Are you still here? > > > From taking a closer look at the code Unicode support is at best to be described as > >'rudimentary', lots of fine points still missing in there. > > I'm sure Anthony will agree. Especially with the upcoming Py3000 there will > be many questions to answer regarding byte-strams, unicode-streams, characterset > conversion (implicit/explicit), character representation. > > See the change history to see when Anthony started to focus on character set > conversion. > > Amaury Forgeot d'Arc who also gives valueable input is probably also interested > in that topic while speeking and writing a language with many special characters. I indeed proposed a patch one year ago, to support unicode. It was against version 4.2.1, I join it again in the hope it can be useful. Here are the comments I sent at the time: The visible changes are: - a new cx_Oracle.UNICODE variable type, which accepts and return unicode values. - NVARCHAR columns will return this variable type. - a new test file: UnicodeVar.py covers the most common cases. There are some caveats: - I based my work on the new vt_NationalCharString type (and its charsetForm member). As there are no unit tests for it, I may have broken something there. Same for the new NCLOB type. - Automatic conversion between string and unicode could be supported (should be easy to add, by using connection.encoding) - I suspect it will only work if Python is compiled in UCS2 mode. (== sizeof(PyUNICODE) must be 2) -- Amaury Forgeot d'Arc |