PEPPLER.ORG
Michael Peppler
Sybase Consulting
Menu
Home
Sybase on Linux
Install Guide for Sybase on Linux
General Sybase Resources
General Perl Resources
Freeware
Sybperl
Sybase::Simple
DBD::Sybase
BCP Tool
Bug Tracker
Mailing List Archive
Downloads Directory
FAQs
Sybase on Linux FAQ
Sybperl FAQ
Personal
Michael Peppler's resume

sybperl-l Archive

Up    Prev    Next    

From: Michael Peppler <mpeppler at MBAY dot NET>
Subject: Sybase::CTlib & character sets
Date: Oct 30 1997 6:24PM

In DBlib it is possible to set the character set of the client
by calling DBSETLCHARSET(). In CTlib the process is
a lot more convoluted: you have to allocate a cs_locale structure,
initialize it with appropriate values, and then link it to the
connection struct before opening the connection (via ct_con_props).

I'd like to allow setting of character sets in CTlib (because
it is sometimes necessary when the server has a non-standard default
character set).

There are two ways that I can see that this can be done - and before
I code too much I'd like to get some feedback from those of you
who have to use this stuff :-)

The first solution is to use the $attr hash (4th parameter) to 
new/ct_connect, and let the user pass a character set name and/or 
language name in this hash.

Something like:

$dbh = new Sybase::CTlib 'sa', 'sapwd', 'SYBASE', {CS_CHARSET =>
'iso_1'};

The other option would be to implement cs_locale() somehow, so you
would say something like:

cs_locale(CS_CHARSET, 'iso_1');
$dbh = new Sybase::CTlib 'sa', 'sapwd', 'SYBASE';

Comments?

Michael
-- 
Michael Peppler       -||-  Data Migrations Inc.
mpeppler@datamig.com  -||-  http://www.mbay.net/~mpeppler