On Wed, Aug 08, 2007 at 12:36:26AM +0200, Tobias Kremer wrote: > Am 08.08.2007 um 00:30 schrieb Tatsuhiko Miyagawa: > >Using Template::Provider::Encoding + Template::Stash::ForceUTF8 is one > >way to avoid these annoying utf-8 bytes vs. Unicode string woes. > > Might be the case. But I really like to understand what is causing this > problem instead of just working around it with some plugins.
Like I said, I suspect what's happening is you are reading in your utf8 templates and failing to decode them into Perl's internal encoding. Then when you print it out it gets printed as-is. You are not generating utf8 as much as passing it through. But the month names are encoded correctly in perl's internal. So when you print you have a mix of encodings. Actually, I'm kind of wondering why you are not getting wide char in print warnings. So, maybe I'm not correct on that. The plugins don't work around the problem, they handle the input and output correctly for you. If you want to understand it more then hack Template::Provider and see if the utf8 flag is set on the fetched templates. Then do the same with the month names. I would not use Template::Stash::ForceUTF8. My opinion is you should be more careful about your input and correctly decode it where it enters your application. Template::Provider::Encoding is cool, but you don't really need it if all your templates are utf8 you can just tell TT that fact and let it decode everything the same. > The saying goes that if you keep everything utf8-encoded you don't > have to worry much about encoding. In this case apparently > everything _IS_ utf8 encoded but nevertheless it breaks for certain > parts. You know your templates are utf8, but have you anywhere actually told perl that fact? Anyway, this isn't really DateTime related. -- Bill Moseley [EMAIL PROTECTED]
