[Catalyst] Catalyst Unicode woes ...
Daisuke Maki
daisuke at endeworks.jp
Thu Aug 9 13:53:50 GMT 2007
I've been doing Japanese web pages for such a long time now, and yet I
still can't claim to have a full grasp of things.
But anyways, what I do is:
* All my templates are in unicode (open documents
with set enc=utf-8, NO BOM), as well as my FormFu
config files.
* I do NOT use UTF8Columns for my DBIx::Class schema
* I do NOT use things like C::P::Unicode, T::P::Encoding
I think that means all of my data is in octets, so I have to jump hoops
when I want to enforce Unicode semantics, such as truncating a string to
X number of characteers, as opposed to bytes. Other than that little
"detail", this is working fine for me.
I suppose it's a hack, but I couldn't get things to really work the
other way around. I don't thinks this is the best practice at all, but
just so you know ...
--d
Tobias Kremerwrote:
> Following up on a conversion I started on the DateTime mailing-list I'd like to
> ask if it is really neccessary to use C::P::Unicode if a site uses
> utf8-encoding?
>
> I have the problem that up until now everything worked absolutely fine without
> C::P::Unicode, Template::Stash::ForceUTF8, Template::Provider::Encoding or any
> other unicode plugin because I believed that if everything is utf8 you don't
> really have to worry about it that much.
>
> Now I recently incorporated DateTime::Locale to get a list of localized month
> names. Spitting them out in my templates revealed a <questionmark> symbol
> instead of all german umlauts. I took a look at DateTime::Locale and everything
> seems to be correct (use utf8 at the top, etc) so this can't be the culprit.
> encode("utf8")-ing the month names makes them look correct. I asked about this
> on the DateTime mailing list and everybody suggested a truckload of plugins to
> incorporate in Catalyst which _ALL_ break everything else on my site except the
> month names which are displayed fine then. It looks like everything gets
> encoded twice when utilizing these plugins.
>
> So I must admit I'm stuck with this. What is the best-practice for dealing with
> Catalyst and utf8? Do I really need C::P::Unicode to make this work correctly?
> What about the various TT plugins? And why the heck is everything double utf8
> encoded when using these plugins that everybody else seems to use?
>
> Thanks a lot for any input!
>
> --Tobias
>
> _______________________________________________
> List: Catalyst at lists.rawmode.org
> Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
> Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
> Dev site: http://dev.catalyst.perl.org/
>
More information about the Catalyst
mailing list