[prev] [thread] [next] [Date index for 2004/07/14]
Hello
We use Template Toolkit now at several parts in our corporate intranet.
We use iso encodings as standard encoding (8859-1 for german language /
8859-2 for the new tchech language pages) . As database we use Oracle
with DBD::Oracle. Some parts of the page use xml files (some config
files, some content files...) which we usually parse with XML::Simple.
This combination sometimes leads to Template Toolkit switching to
Unicode Output (the whole output is converted). The problem is that this
happens in some of our Perl Modules on somehow random basis, so we can't
predict what encoding the output is in. On the servers that are running
perl 5.8 + it is no problem because i can do a check and convert it if
needed, like ($encoding set to the right encoding for the needed language):
if ($] > 5.007) {
if (Encode::is_utf8($output)) {
$output=Encode::encode("$encoding",$output);
}
}
but the problem is some of our production servers are still running perl
5.6.1 and we can't upgarde them very easy.
Changing all output to utf8 would be possible but a lot of work, since
all our Database Data, and old Perl scripts that don't use Templates had
to be converted to unicode too.
The question now is how can I find out (using perl 5.6.1) if the output
from Template Toolkit is converted to Unicode or not, the conversion
would be no problem with Unicode::String? I only need to know if i have
to convert or not.
Kai
_______________________________________________
templates mailing list
templates@xxxxxxxxxxxxxxxx.xxx
http://lists.template-toolkit.org/mailman/listinfo/templates
|
[Templates] Problem with Unicode Switching
|
Generated at 08:56 on 15 Mar 2005 by mariachi v0.52