Skip to Content.
Sympa Menu

freetds - Re: [freetds] How to Turn Off Character Conversion Failed Warnings

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Eli Finkelshteyn <vengeanceofalf AT gmail.com>
  • To: freetds AT lists.ibiblio.org
  • Subject: Re: [freetds] How to Turn Off Character Conversion Failed Warnings
  • Date: Mon, 15 Nov 2010 14:09:31 -0500

Hi David,
Unless I'm missing something, this seems like the same advice I've seen in
other places. It's not helpful to me because I'm already using "Client
Charset = UTF-8." This does not, and should not solve my problem as this can
only convert characters into UTF-8 that are correctly encoded in the
database. In my case-- and this is my main problem-- I have a char field
(note: chars are supposed to hold ASCII characters and nothing else) that
has cp1252 inserted into it. Because of this, when FreeTDS grabs data from
that field, assumes it's ASCII, and tries to convert it to UTF-8, it blows
up since some of those cp1252 code points don't exist in UTF-8 (i.e. code
point 253-- a y with an accent sign-- among others).

To reiterate from my last email, I'm completely fine with losing those
characters. Whoever threw them into the db messed up, and if I can get
FreeTDS to replace them with question marks, I can just filter those values
out and be done with the whole thing. It even sounds like FreeTDS wants to
do this as it gives me the warning "Some character could not be converted
into client's character set. Unconverted bytes were changed to question
marks ('?')." But then, instead of actually leaving unconverted bytes as
question marks, FreeTDS instead kills my whole program. Does anyone at all
know how to change this behavior? I know it should be possible based on the
"set char_convert on with no error" option in Sybase. Is there nothing
similar I can throw into FreeTDS.conf?

Help, please?

Regards,
Eli

On 11/12/2010 3:03 AM, David Dick wrote:

On 12/11/10 07:52, Eli Finkelshteyn wrote:

Hi Folks,
I'm using FreeTDS with Perl and DBD::Sybase to connect to a MSSQL 2008
server. Normally, this is well and good, but today I noticed that someone
thought it would be a good idea to write cp1252 data to a char column I'm
selecting from. This promptly made FreeTDS and Perl fail with the error:
"*Some
character(s) could not be converted into client's character set.
Unconverted bytes were changed to question marks ('?')*"

Now, that's completely fine, and I'm willing to live with the question
marks. The problem is that this warning is read as an error by Perl and
breaks my code!

Googling around, I found that I can use " * set * * char_convert on with no
error*" on a normal Sybase server to ignore this and go on with the code.
Is there some equivalent I can send to FreeTDS, or DBD::Sybase (perhaps a
setting in freetds.conf?) to do the same? I would find that immensely
helpful!


I wrote a <a
href="http://use.perl.org/~ddick/journal/39102";<http://use.perl.org/%7Eddick/journal/39102>
>use.perl.org journal</a> which might be useful
_______________________________________________
FreeTDS mailing list
FreeTDS AT lists.ibiblio.org
http://lists.ibiblio.org/mailman/listinfo/freetds




Archive powered by MHonArc 2.6.24.

Top of Page