I've been seeing strange behavior with data that includes accents.
(Not sure if this qualifies as unicode or not, since I recall accented
letters being in the ASCII charset.)
In irb, all is well:
>> Item.find_by_RecKey("CVNSBK07C").full_description
=> "Ceàgo Vinegarden (Biodynamic) Sauvignon Blanc Kathleen's Vineyard
2007"
But if I pull the field in RSpec:
expected: "Ceàgo Vinegarden (Biodynamic) Sauvignon Blanc Kathleen's
Vineyard 2007"
got: "Ce?go Vinegarden (Biodynamic) Sauvignon Blanc Kathleen's
Vineyard 2007"
It's not just RSpec either, if I print it to a view in Rails, it
contains a question mark as well.
I've spent hours digging through the stack with the debugger, trying
to track it down, and I'm just as confused as I was before. I'm hoping
someone has already dealt with this problem, and has some ideas. Help?
The trick is in ~/.freetds.conf:
[YOURSERVER]
host = yourserver.com
port = 1433
tds version = 7.0
text size = 64512
client encoding = UTF-8
client charset = UTF-8
Adding the last line "client charset" fixed it for me... "client
encoding" wasn't enough.
- Cheers,
Ken
> --
> You received this message because you are subscribed to the Google Groups "Rails SQLServer Adapter" group.
> To post to this group, send email to rails-sqlse...@googlegroups.com.
> To unsubscribe from this group, send email to rails-sqlserver-a...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/rails-sqlserver-adapter?hl=en.
>