[html-formfu] Error when encoding the error messages
Octavian Râşniţă
orasnita at gmail.com
Fri Oct 30 20:14:48 GMT 2009
Hi,
I use Catalyst::Plugin::I18N::DBI for I18N with HTML::FormFu and in some
cases the error messages are not encoded correctly to UTF-8.
For example, instead of
Trebuie să aibă între 6 şi 20 caractere
the message is:
Trebuie sÄ aibÄ Ã®ntre 6 Åi 20 caractere
In other cases where the error messages don't contain [_1]... the messages
are printed well, with all those special chars for romanian language.
The settings I use in the Catalyst app configuration file for
Catalyst::Plugin::I18N::DBI are:
'I18N::DBI' => {
dsn => 'dbi:mysql:database=brk',
user => 'root',
password => "",
languages => ['ro', 'en'],
lexicons => ['site'],
lex_class => 'DB::Lexicon',
default_lang => 'en',
},
The translations are done well on the entire site and also those
HTML::FormFu error messages that don't contain variables marked with [_1]...
I've checked the database and the strings are stored well there. I've taken
the standard HTML::FormFu error messages from the lexicon hash from the
HTML::FormFu::I18N::ro module.
In MyApp::Schema::Result::Lexicon DBIC class module I have put:
__PACKAGE__->load_components("UTF8Columns");
__PACKAGE__->utf8_columns(qw/lex key value notes/);
I have also tried to comment these 2 lines, but with no effect.
I thought that maybe Catalyst::Plugin::I18N::DBI that uses
Locale::Maketext::Lexicon::DBI doesn't connect well to the database (MySQL)
and doesn't get the values as UTF-8 encoded, but it is not the case since
other HTML::FormFu error messages are printed fine.
Do you have any idea what could be the problem?
Thank you.
Octavian
More information about the HTML-FormFu
mailing list