On Wed, Sep 05, 2007 at 08:57:43AM +0200, Igor K. wrote:
- windows locale to Russia
- environment.rb
ENV[‘LC_CTYPE’] = ‘ru_RU.UTF-8’
Ferret.locale = “ru_RU.UTF-8”
- and what was important to change database locale from UTF8-unicode to
UTF8-general.
But as i espect it was no finish of problems:
- because it index data incorrect, for example some data came to index
db. The other problem is when - some objects it can find and some
not(russian objects),
Have you checked with the Ferret browser to make sure it really indexed
incorret values? Have you rebuilt your index after changing these locale
things?
when i search by ‘*’ i can get all objects, but with ‘**’ i get only
part of them.
I’m not sure what Ferret does with a query like ‘**’…
what version of ferret-server, acts-as-ferret, locale in MySQL database
do you have?
I used the aaf from inside your app when checking it out, and ferret
0.11.4.
Here’s a small checklist I use for making sure everything is UTF-8:
HTTP/HTML
content-type delivered by web server
should be ‘Content-Type: text/html; charset=utf-8’
html content-type meta tag
should be ‘’
Mysql settings:
In your application’s console, execute the following:
r = Post.connection.execute “SHOW VARIABLES LIKE ‘character%’”
r.each {|r|puts r}
This should result in something like this:
character_set_client
utf8
character_set_connection
utf8
character_set_database
utf8
If your output differs, try the following:
set ‘encoding: utf8’ in environment.rb
(this affects the character_set_connection and character_set_client
values)
set ‘default-character-set=utf8’ in the mysqld section of the mysql
configuration (/etc/mysql/my.cnf on linux). After restart of the
server,
newly created databases will be utf8 by default, and new tables in
these
databases will inherit this setting. Maybe it’s possible to change the
character set of existing databases/tables, too, however your data
will
have to be converted, too. The per database setting imho is only a
default setting applied to new tables.
with all these settings in place, everything should be fine on the UTF-8
front
Cheers,
Jens
–
Jens Krämer
webit! Gesellschaft für neue Medien mbH
Schnorrstraße 76 | 01069 Dresden
Telefon +49 351 46766-0 | Telefax +49 351 46766-66
[email protected] | www.webit.de
Amtsgericht Dresden | HRB 15422
GF Sven Haubold, Hagen Malessa