From: Lou Vanek Date: 2006-01-12T03:18:20+09:00 Subject: Re: ruby-odbc -- Strange Chaning of Special Character in Result Set I'm not familiar with FreeTDS, but Google says that some versions of FreeTDS have problems with extended ascii: http://lists.ibiblio.org/pipermail/freetds/2003q2/012800.html http://lists.ibiblio.org/pipermail/freetds/2003q2/012791.html http://www.phpbuilder.com/board/history/topic.php/10268497-1.html so it appears that if you are running FreeTDS .61, extended ascii is broken. Your FreeTDS log should show the error. What does your log say? [http://www.freetds.org/userguide/logging.htm] On retrieving data from the server, FreeTDS substitutes an ASCII '?' in the character's place, and emits a warning message stating that some characters could not be converted. [http://www.freetds.org/userguide/nonwestern.htm] This explains why '150' is mysteriously being converted to 63 (i.e. '?'). Ben Gribaudo wrote: > Hi Lou, > > Thanks for your reply. > > >>I recommend sending your output to a file and doing something similar to >>what I've done to see exactly what's being sent back from odbc instead >>of relying on a (possibly lying) terminal. It would also have been helpful to >>know which database [and version] you used. > > > I'm not concerned about if/how the terminal outputs the character--that > output was for illustration only. The "Char Code" line is the one of > interest. In my original script, shouldn't the terminal output this > number correctly? > > Running your script and looking at the output file still shows a char > code of 63 for select char(150) and 150 for select ascii(char(150)). > :-( > > I'm using MS Sql Server 7.0, FreeTDS and Ruby-ODBC. > > >>I didn't get any warnings when compiling ruby-odbc, but I was using gcc 34.4. > > > Christian (author of ruby-odbc) communicated with me about this and > provided a solution to the signedness difference error. Thank you, > Christian! > > Ben