rails-sqlserver/tiny_tds — Issue #67: Encoding probles on freetds 0.82 and Ubuntu 10.10 LTS
Author: petRUShka
Created: 2011-12-12 21:59:41+00:00
State: open

I'm using same code on Ubuntu 10.10 and Arch Linux. As I can find, the main difference is version of freetds.

I use tiny_tds (0.4.5) with Rails 2.3.10 and activerecord-sqlserver-adapter (2.3.18). If I fetch some data from SQL server on Arch linux it is ok:

Person.last
=> #

The attribute `code` looks exactly how it is looks in Russian. But if I switch to Ubuntu 10.10 I will see such encoding issue:

>> Person.last
=> #

I don't know what to do. I have almost same config on both machines.

Ubuntu 10.10:

$ tsql -C
Compile-time settings (established with the "configure" script)
Version: freetds v0.82
freetds.conf directory: /etc/freetds
MS db-lib source compatibility: no
Sybase binary compatibility: yes
Thread safety: yes
iconv library: yes
TDS version: 4.2
iODBC: no
unixodbc: yes

$ ruby -v
ruby 1.8.7 (2011-02-18 patchlevel 334) [i486-linux], MBARI 0x8770, Ruby Enterprise Edition 2011.03

Arch Linux:

$ tsql -C
Compile-time settings (established with the "configure" script)
Version: freetds v0.91
freetds.conf directory: /etc/freetds
MS db-lib source compatibility: yes
Sybase binary compatibility: no
Thread safety: yes
iconv library: yes
TDS version: 7.0
iODBC: no
unixodbc: yes
SSPI "trusted" logins: no
Kerberos: no

$ ruby -v
ruby 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux]i

I have the same config on both servers:

$cat config/database.yml
ms-db:
adapter: sqlserver
username: user
password: password
host: sqlserver.myhost.ru

I tried to use `tds_version: 42` in config on Ubuntu machine, but this didn't help.

So may be the reason is version of freetds...