Re: [cx-oracle-users] Antw: Bad conversion of a unicode value?
Brought to you by:
atuining
From: Jim P. <uni...@gm...> - 2007-11-30 01:25:55
|
On Nov 29, 2007 1:48 PM, Anthony Tuininga <ant...@gm...> wrote: > Recently I have been > looking into this again (in conjunction with the ceODBC module) and > ran into a few difficulties since most Unix builds are wide unicode > and not narrow. Windows, of course, is different in this respect. Your > code assumes a narrow build so I'd have to come up with a solution for > that. I believe somewhere in this thread a solution to that problem > has been given but I'll have to see if it really solves the problem or > not. Using AL23UTF8 as the encoding for OCI prevents this issue. You still have to do all the other stuff (like handling buffer requirements expansions, conversions, ...) but the code will work on all OSes and machines. The only downside to UTF8 might be performance. We would be taking the Unicode in the internal Python format and converting it to UTF-8 then passing it to OCI who might need to convert it to something else for storage inside Oracle. However, the default for Oracle 10G for a Unicode database is AL32UTF8, so I'm guessing that will not be a problem for most people going forward. It looks like Oracle is choosing UTF-8 as the top among equals since some features like Unicode for XML in Oracle 10G requires that the database be UTF-8. Jim P. |