Re: unicode via DBI on linux to sql server 2005?
- From: bugbear <bugbear@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 28 Feb 2008 16:47:57 +0000
bugbear wrote:
I'm not really sure which forum to post this on!
I am attempting to retrieve data from an sql server 2005 database, hosted,
store and manipulated on a Windows box.
My code is running on a Linux box, and I have been given
read-only access to the DB server.
Connection via DBI is working well, but I am failing
to extract unicode data from the DB, which I understand
from googling is stored internally as UCS2.
(I can get ascii data and numeric data fine)
I am using perl, DBI, and the DBD::Sybase driver.
So - has anyone retrieved "international" data
in the same (or similar) circumstances as this?
Ye - me! It turns out the client character
set, into which the connection attempts to encode
the data, is NOT set from the DBI connection string
http://search.cpan.org/~mewp/DBD-Sybase-1.08/Sybase.pm
i.e. charset=utf-8
but in the freedts.conf file, which is part of the connection.
http://www.freetds.org/userguide/freetdsconf.htm
as the "client charset" parameter.
So I added
client charset = UTF8
And my code did what I needed.
Hoping this helps someone else...
BugBear
.
- References:
- unicode via DBI on linux to sql server 2005?
- From: bugbear
- unicode via DBI on linux to sql server 2005?
- Prev by Date: Re: executing source command from perl
- Next by Date: Re: how to remove the letter n from a line of text
- Previous by thread: unicode via DBI on linux to sql server 2005?
- Next by thread: Help with script
- Index(es):
Relevant Pages
|
|