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 mbay dot net>
Subject: Selecting charset or language from sybperl
Date: Jan 21 1999 9:44PM

>>>>> "Antonio" == Antonio Vasconcelos  writes:

Antonio> I'm looking for a way to make sybperl do (or don't do)
Antonio> charset conversions for me.

Antonio> The server I'm accessing via Sybase::CTLIB is a M$-SQL Server
Antonio> 6.5, I had no connectivity problems whatsoever, I just
Antonio> created a server running in port 1433 in the interfaces file
Antonio> and I can access it from isql or sybperl.

Antonio> The problem is that I have a lot of TEXT and VARCHAR fields
Antonio> with national chars, I think that this chars are in iso8859-1
Antonio> (Latin 1) as they were typed in from HTML froms via .IDC +
Antonio> .HTX scripts/pages into a M$-IIS 3 server and then sent to
Antonio> the SQL server. All users are using portuguese / spanish /
Antonio> english versions of w95 / 98 and portuguese or spanhish
Antonio> keyboards.

I suspect that IIS and SQL Server is converting the iso8859-1
characters to some MS encoding of some sort. I did a quick run to
check all the character values/mappings here and the mapping that ç is 
turned into on your second example doesn't exist (Solaris 7, Sparc,
Netscape 4.5).

Antonio> a) The data inside the tables IS NOT in iso8859-1 but the IIS
Antonio> server is providing conversion and Sybperl don't so, I got
Antonio> unconverted chars in God knows what code page

What is the default character set for MS-SQL server? Do you have any
localization installed? This *may* also be a communication problem
between MS-SQL server and Sybase's OpenClient.

Antonio> b) The data is IN iso8859-1 but sybperl are doing charset
Antonio> conversion to something different.

Probably not, unless you've set the locale to something specific on
the linux box.

Antonio> I tryed to call $db->ct_con_props(CS_CHARSETCNV, << 0 or 1 >>
Antonio> ) but it looks to be unsupported by sybperl as I receive:

Indeed. However CS_CHARSETCNV is a read-only value (according to the
Sybase docs) so you can't force conversion NOT to happen...

I suspect that I need to add some form of cs_locale() support to
Sybase::CTlib to allow the user to define the character set that he is 
using (Sybase::DBlib supports this via DBSETLCHARSET()).

You can do some more research on this by selecting only the ç in
'intervençao' (using substring() for example) and using ascii() on it
to see what it is stored as. Run this both using an MS client (don't
know if they have a command line tool à la isql) and using either isql 
or sybperl (or both) from the linux client.

This should enable you to find out who is doing the conversion...

Michael Peppler         -||-  Data Migrations Inc.       -||-
Int. Sybase User Group  -||-
Sybase on Linux mailing list:
Sybase/Linux FAQ:
To unsubscribe: send body "unsubscribe ase-linux-list "