charset trouble

From: Ing. Branislav Gerzo (2ge_at_2ge.us)
Date: 03/21/05


Date: Mon, 21 Mar 2005 15:18:51 +0100
To: dbi-users@perl.org

Hello all,

I'm using AS perl 5.8.6 on win2003, I can't continue work, because I
don't understand what's going here:

I have in MSSQL table, where I have only 1 column, and 1 row, which
contains accent c (alt+0232 or \xE8)

When I run this script:

use strict;
use warnings;
use DBI;

my $dbh = DBI->connect('dbi:ODBC:test');
$dbh->{RaiseError} = 1;
$dbh->do("SET NOCOUNT ON");

my ($a) = $dbh->selectrow_array ('select char from test');
print ord($a), "\n";
print ord('c'), "\n";
__END__

I get:
99
99
-------------------------------------------------

It seems, that ODBC(?) driver is making some conversions here, but I
look into ODBC connection, try to change settings, but nothing helps.
I use latest DBI/ODBC drivers.

Could anyone explain me this?

/Brano