handling unicode data

Filipe fcorreia at gmail.com
Thu Jul 6 11:42:32 EDT 2006


Hi Martin,

> One would have to ask the authors of pymssql, or Microsoft,
> why that happens; alternatively, you have to run pymssql
> in a debugger to find out yourself.

Tried running pymssql in a debugger, but I felt a bit lost. There are
too many things I would need to understand about pymssql first.

Meanwhile, I got to some very interesting conclusions. Remember the
"ANSI-to-OEM conversion" option you mentioned before? I began reading
some docs about it and this description turned up:

"The ANSI to OEM conversion translates data coming back from SQL Server
into the local code page used by your client."

which seemed exactly what I don't want..   so I turned it to "OFF" (by
using the registry key
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSSQLServer\Client\DB-Lib\AutoAnsiToOem)
and everything started working the way I was originally expecting!

I think that the best way to actually solve this will be to override
AutoAnsiToOem (instead of using the registry setting) from within
pymssql, or find a way to specify what the "local code page" should be.
If not, I will have to have the pain of verifying this setting in every
system where the code I'm developing will be deployed. Which reminds
me... that this setting doesn't exist on non-windows environments (ie,
no registry on Linux) so I'm not sure how will it all work there.
Anyone with experience in using DB-Library that can confirm how it
works (namely, on linux)?
(but perhaps this is outside the scope of this newsgroup.. )

I got in touch with Andrzej Kukula, the current developer of pymssql,
who has also been very helpful, and knows what we've been discussing
over here.


thanks for all the help,
Filipe




More information about the Python-list mailing list