开发者

How to get 'è' (and not 'e') with activerecord and ruby 1.8.7

开发者 https://www.devze.com 2022-12-22 13:45 出处:网络
I am writing a simple script to update a table data. I am unable to get a record trough a field named \"Agliè\"; the problem is \"è\".

I am writing a simple script to update a table data. I am unable to get a record trough a field named "Agliè"; the problem is "è".

c = Comune.find_by_denominazione_italiano_tedesco('Agliè')

I realised that the problem can be patched using "Aglie", but I need to preserve the accent difference (these are town names, some are the same, except of the accent).

My db character set is UTF-8, the collation is latin1_swedish_ci; how开发者_如何学Goever, changing it to utf8_general_ci makes no difference. My ruby script is in utf-8; I tried changing it to latin1 as well, no difference again.

Any suggestion?

Cheers,

Davide


Looks like it was a file encoding problem after all, grr. Thanks anyway folks.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号