Michael Peppler
Sybase Consulting
Sybase on Linux
Install Guide for Sybase on Linux
General Sybase Resources
General Perl Resources
BCP Tool
Bug Tracker
Mailing List Archive
Downloads Directory
Sybase on Linux FAQ
Sybperl FAQ
Michael Peppler's resume

sybperl-l Archive

Up    Prev    Next    

From: Michael Peppler <mpeppler at peppler dot org>
Subject: Re: iso_1 and unicode
Date: Mar 7 2003 3:30PM

I'm sorry for the delay - did you ever get an answer to this issue?


On Sat, 2003-02-15 at 06:45, wrote:

> Hi
> I'm having a little trouble trying to mimic the -J  switch  on  sybase's
> bcp command via Sybase::CTlib. I'm trying to pull a text field  from  an
> iso_1 server, convert it to unicode, and put it in a utf8 server.
> sybase docs tell me this:
>    run bcp "out" with the -Jutf8 switch (on the  iso_1  server)  and ensure
>    sp_configure "enable unicode conversions", 2 is  set.  then  bcp
>    "in" the file to the utf8 server.
>    (sounds easy enough)
> now, i'd like to use perl to do this...
> I infer this from the Sybase::CTlib (v2.15):
> use CS_SYB_CHARSET when connecting to the iso_1  server.
> ie.
>    my $dbh Sybase::CTlib->new($user, $pwd, $server, $pname, \
>                           { CON_PROPS => {CS_SYB_CHARSET =>'utf8'} });
> #now I figured I could get the property that indicated if conversion
> #was taking place if I select from this connection
>    my $val;
>    my $rc = $dbh->ct_con_props(CS_GET, CS_CHARSETCNV, $val, CS_INT_TYPE);
>    if($rc == CS_SUCCEED) {
>          print "val=$val\n";
>    } else {
>       print "ct_con_props failed\n";
>    }
> However, $val prints 0 in this case. I wouldn't expect that since unicode
> conversion is indeed set on the server.
> Has anyone else been down this path?
> Thanks,
> Steve
Michael Peppler                              Data Migrations, Inc.       
Sybase T-SQL/OpenClient/OpenServer/C/Perl developer available for short or 
long term contract positions -