Skip Menu |

This queue is for tickets about the Template-Toolkit CPAN distribution.

Report information
The Basics
Id: 45842
Status: resolved
Worked: 2 hours (120 min)
Priority: 0/
Queue: Template-Toolkit

People
Owner: cpan [...] wardley.org
Requestors: MVUETS [...] cpan.org
Cc: KAPPA [...] cpan.org
makamaka [...] cpan.org
AdminCc:

Bug Information
Severity: Critical
Broken in:
  • 2.20
  • 2.20_1
Fixed in: (no value)



CC: KAPPA [...] cpan.org, makamaka [...] cpan.org
Subject: Template::Stash::XS is broken to deal with UTF-8
Template::Stash::XS cannot properly handle UTF-8 strings: it doesn't work with UTF-8 hash keys at all. This bug relates to #45017 and #43323. As a workaround you can say Template to use Template::Stash instead of its XS-version: $Template::Config::STASH = 'Template::Stash'; The complete proof and workaround demonstration: use strict; use warnings; use utf8; use Template; binmode STDOUT, ':utf8'; # XXX: uncomment this to make Template work properly #$Template::Config::STASH = 'Template::Stash'; Template->new()->process(\*DATA, { ascii => 'key', utf8 => 'ключ', hash => { key => 'value', ключ => 'значение' }, str => 'щука' }); __DATA__ ascii = [% ascii %] hash.$ascii = [% hash.$ascii %] utf8 = [% utf8 %] hash.$utf8 = [% hash.$utf8 %] str.length = [% str.length %]