RE: [dbi] Unicode-Patch for DBD::ODBC



Please let me know what you come up with for a final patch and I will
try to incorporate this weekend...

-----Original Message-----
From: Alexander Foken [mailto:alexander@xxxxxxxx]
Sent: Tuesday, March 21, 2006 2:56 AM
To: Martin J. Evans
Cc: dbi-users@xxxxxxxx
Subject: Re: [dbi] Unicode-Patch for DBD::ODBC

Hello Martin,

just a quick reply, I'm in a hurry, so please let me verify this
later.

Yes, this really looks wrong. But if I remember right, there was a
reason for the "+". I think I (ab)used phs->sv to store Unicode in a
char[], so I just made sure there was enough room for the trailing
U+0000. If that's right, phs->maxlen counts bytes, not characters.

Or maybe I really missed the Shift key twice. ;-)

Alexander

Martin J. Evans wrote:

Alexander,

Thanks for this. I've not had a chance to try it but a quick scan
showed:

- SvGROW(phs->sv, (phs->maxlen < 28) ? 28 : phs->maxlen+1);
+ SvGROW(phs->sv, (phs->maxlen+sizeof(WCHAR) < 28) ? 28 :
phs->maxlen+sizeof(WCHAR));

Only because I was looking at this very line the other day it stood
out -
should that be "*sizeof(WCHAR)".

Martin
--
Martin J. Evans
Easysoft Ltd, UK
http://www.easysoft.com

On 15-Mar-2006 Alexander Foken wrote:


Hello DBI-users,

I've written a first patch for DBD::ODBC to support Unicode. The
patch
was developed to make a custom project management software work with
Unicode on Win32 with Microsoft's SQL Server via ODBC. It is in use
at
several clients since about six months. So far, no bugs have been
reported for the modified DBD::ODBC driver.

The patch is available for download at from
http://www.alexander-foken.de/unicode-patch.txt.gz. You find
detailed
information in the README.unicode-patch file, HTML version available
at
http://www.alexander-foken.de/README.unicode-patch.html.

Please remember to read the README.unicode-patch file, especially
the
"Known Problems" section. There are still some rough edges where
things
work different than you may expect.

Alexander

--
Alexander Foken
mailto:alexander@xxxxxxxx http://www.foken.de/alexander/







--
Alexander Foken
mailto:alexander@xxxxxxxx http://www.foken.de/alexander/

.



Relevant Pages

  • Re: [dbi] Unicode-Patch for DBD::ODBC
    ... I think I used phs->sv to store Unicode in a char, so I just made sure there was enough room for the trailing U+0000. ... Martin J. Evans wrote: ... The patch was developed to make a custom project management software work with Unicode on Win32 with Microsoft's SQL Server via ODBC. ...
    (perl.dbi.users)
  • Re: next version of DBD::ODBC including available unicode patch?
    ... It can't work, because the ODBC API only accepts non-Unicode SQL statements, or at least I did not find a way to make ODBC work with SQL strings encoded in UTF-8 or UTF-16 from a non-Unicode application like perl.exe. ... I do not have enough insight into ODBC on Win32 and the inner workings of DBI drivers to declare my patch as good enough for a release. ... For that, I would need to be sure that the code is right and works with all of DBI, not just know that it works with *one* application that uses only a small part of DBI. ...
    (perl.dbi.users)
  • Re: Linux console UTF-8 mode corrupts keymap
    ... The patch below fixes this for ASCII ... I'm playing with the kernel's keymap code wrt allowing Caps Lock to affect ... Unicode characters. ...
    (comp.os.linux.misc)
  • Re: for arabic characters getting question marks while fetching rows from ms sql Database
    ... DBD::ODBC does not support Unicode (and thus arabic characters) at all. ... You may want to try my patch for DBD::ODBC: README file at http://www.alexander-foken.de/README.unicode-patch.html, ... If you use Oracle or PostgreSQL, don't take the detour via ODBC, use a native driver like DBD::Oracle or DBD::Pg. ...
    (perl.dbi.users)
  • Re: sys.path and unicode folder names
    ... I already managed to make a Patch for this problem. ... I will post it soon on my website and in this group. ... Martin v. Löwis wrote: ... I am interested in the general case of Unicode. ...
    (comp.lang.python)