List Info

Thread: Re: TT and UNICODE: Garbled special characters




Re: TT and UNICODE: Garbled special characters
user name
2007-09-05 06:16:41
On 9/5/07, Daniel McBrearty <danielmcbreartygmail.com> wrote:
> how your editor is actually writing that u-with-umlaut
into the text
> file will also be a fatcor (it might be entering
ISO-8859-1 or UTF8).
>
> try using the appropriate x{ ... } way of writing the
char to see if
> this is your problem.

NOW i am trying the suggested way
* In controller test.pm > added the following (note the
German Umlaut)
sub index : Private {
   my ( $self, $c ) = _;
       $c->stash-> = "xFC"; #
<--- German Umlaut
       $c->stash-> = 'test.tt2';
}

* made sure that encoding of controller "test.pm"
and view template
"test.tt2" is *ASCII*

* starting server and going to url : __character is still
garbled__

It seems to me that Template-Toolkit does no UTF-8-encoding
of the
outputted variables.

_______________________________________________
List: Catalystlists.rawmode.org
Listinfo: ht
tp://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-
archive.com/catalystlists.rawmode.org/
Dev site: http://dev.catalyst.per
l.org/

Re: TT and UNICODE: Garbled special characters
user name
2007-09-05 06:25:15
>
> It seems to me that Template-Toolkit does no
UTF-8-encoding of the
> outputted variables.

well, it shouldn't.

In perl, strings are already utf8, internally. If TT was to
do
encoding, they would be double-encoded.

so what you have to do is get that u-with-umlaut *into* perl
as a utf8
encoded string. which is a combination of whatever your
editor is
doing, and the utf8 pragma.

strange that you still get the problem when you use the x
notation though.

have you tried just writing a test script and outputting the
string
into a utf8-aware terminal?

-- 
Daniel McBrearty
email : danielmcbrearty at gmail.com
http://www.engoi.com
http://danmcb.vox.com
http://danmcb.blogger.com
find me on linkedin and facebook
BTW : 0873928131

_______________________________________________
List: Catalystlists.rawmode.org
Listinfo: ht
tp://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-
archive.com/catalystlists.rawmode.org/
Dev site: http://dev.catalyst.per
l.org/

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )