Re: [Catalyst] Plugin::I18N and UTF-8

2008-03-24 Thread Alex Povolotsky

Knut-Olav Hoven wrote:

On Monday 24 March 2008 08:08:06 Alex Povolotsky wrote:
  

Hello!

Having completed UTF-8 quest successfully, I've tried to do I18N and
found the same double-UTF-encoding trouble.

I've put UTF-8 strings into I18N/ru.po file,and configured Plugin:I18N

Plugin::I18N:
maketext_options:
Decode: 0
Encoding: utf-8

(Decode: 1 did not make a difference), and I've got double-encoded
localize.

What and where should I fix?



What other plugins are you using?

  

use Catalyst qw/
-Debug
ConfigLoader Static::Simple
Session Session::State::Cookie Session::Store::FastMmap
Authentication
   Authentication::Credential::Password
   Authorization::ACL
I18N
Upload::Image::Magick
Unicode
/;

Alex.


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Plugin::I18N and UTF-8

2008-03-24 Thread Alex Povolotsky

Andrew Rodland wrote:

On Monday 24 March 2008 02:08:06 am Alex Povolotsky wrote:
  

Hello!

Having completed UTF-8 quest successfully, I've tried to do I18N and
found the same double-UTF-encoding trouble.

I've put UTF-8 strings into I18N/ru.po file,and configured Plugin:I18N

Plugin::I18N:
maketext_options:
Decode: 0
Encoding: utf-8

(Decode: 1 did not make a difference), and I've got double-encoded
localize.

What and where should I fix?

Alex.



Does your pofile have the correct encoding declared? It should say something 
like


msgid 
msgstr 
Content-Type: text/plain; charset=UTF-8

(actually it's likely that there are lots of other headers, but the point is 
that Content-Type should be one of them and it should declare a charset. 
Locale::Maketext::Gettext twigs on this to figure out how to decode.)
  


Added; no visible effect at all, still double-encoded UTF8

Alex.


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Plugin::I18N and UTF-8

2008-03-24 Thread Alex Povolotsky

Knut-Olav Hoven wrote:

On Monday 24 March 2008 14:33:47 Alex Povolotsky wrote:
  

Knut-Olav Hoven wrote:


On Monday 24 March 2008 08:08:06 Alex Povolotsky wrote:
  

Hello!

Having completed UTF-8 quest successfully, I've tried to do I18N and
found the same double-UTF-encoding trouble.

I've put UTF-8 strings into I18N/ru.po file,and configured Plugin:I18N

Plugin::I18N:
maketext_options:
Decode: 0
Encoding: utf-8



Remove the Encoding: utf-8 line

According to the manual of Locale::Maketext::Simple, the Encoding parameter 
implies Decode = 1
  


No difference. BTW, it seems to ALWAYS try to localize strings.

  MACRO l(text, args) BLOCK;
 Catalyst.localize(text, args);
  END;

is defined in root/src/main

Alex.


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Plugin::I18N and UTF-8

2008-03-24 Thread Alex Povolotsky

Knut-Olav Hoven wrote:

On Monday 24 March 2008 14:33:47 Alex Povolotsky wrote:
  

Knut-Olav Hoven wrote:


On Monday 24 March 2008 08:08:06 Alex Povolotsky wrote:
  

Hello!

Having completed UTF-8 quest successfully, I've tried to do I18N and
found the same double-UTF-encoding trouble.

I've put UTF-8 strings into I18N/ru.po file,and configured Plugin:I18N

Plugin::I18N:
maketext_options:
Decode: 0
Encoding: utf-8



Remove the Encoding: utf-8 line

According to the manual of Locale::Maketext::Simple, the Encoding parameter 
implies Decode = 1


  


Well, after some switching on and off, it settled down to work :)

BTW: Locale::Maketext::Extract mentions some [%|l%] TT filter; but I've 
found no clue in Template::Toolkit manual on writing my own filter...


Alex.


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/