Skip to content

Instantly share code, notes, and snippets.

@marnen marnen/errors.txt
Created Oct 26, 2010

Embed
What would you like to do?
Errors when inserting UTF-8 characters into MS SQL Server database with TinyTds
>> db = TinyTds::Client.new :username => 'USER', :password => 'PASSWORD', :dataserver => 'SERVER', :database => 'DB', :encoding => 'UTF-8'
=> #<TinyTds::Client:0x101174a88>
>> db.encoding
=> nil
>> r = db.execute "insert into awards (title) values ('Japanese')"
=> #<TinyTds::Result:0x101167810>
>> r.each
=> []
>> r = db.execute "insert into awards (title) values ('Japanese 日本語です')"
=> #<TinyTds::Result:0x101155188>
>> r.each
=> []
>> r = db.execute "select * from awards where id = 28"=> #<TinyTds::Result:0x10114d258>
>> r.each
=> [{"label"=>nil, "created_at"=>nil, "title"=>"Japanese ?????", "updated_at"=>nil, "id"=>28, "has_scores"=>false, "description"=>nil, "award_type_id"=>nil}]
>> r.first['title']
=> "Japanese ?????"
>> $KCODE
=> "UTF8"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.