Subject: | [PATCH] utf-8 strings in 'uri' and 'url' filters |
Date: | Mon, 24 Nov 2008 15:55:52 +0600 |
To: | bug-Template-Toolkit [...] rt.cpan.org |
From: | "Denis F. Latypoff" <latypoff [...] yandex.ru> |
Hello Bug-Template-Toolkit,
diff -Nru Template-Toolkit-2.20/lib/Template/Filters.pm Template-Toolkit-2.20-utf8_flag/lib/Template/Filters.pm
--- Template-Toolkit-2.20/lib/Template/Filters.pm 2008-08-06 20:49:08.000000000 +0700
+++ Template-Toolkit-2.20-utf8_flag/lib/Template/Filters.pm 2008-11-24 15:42:39.000000000 +0600
@@ -271,7 +271,7 @@
map { ( chr($_), sprintf("%%%02X", $_) ) } (0..255),
};
- if ($] >= 5.008) {
+ if ($] >= 5.008 && utf8::is_utf8($text)) {
utf8::encode($text);
}
@@ -296,7 +296,7 @@
map { ( chr($_), sprintf("%%%02X", $_) ) } (0..255),
};
- if ($] >= 5.008) {
+ if ($] >= 5.008 && utf8::is_utf8($text)) {
utf8::encode($text);
}
--
Best regards,
Denis mailto:latypoff@yandex.ru