forked from xslate/p5-Text-Xslate
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated patch for github issue xslate#88 "Latin 1 text could end up a…
…s malformed UTF-8 on output" (nc) Now using U8 casts - *(d++) = UTF8_EIGHT_BIT_HI(c); - *(d++) = UTF8_EIGHT_BIT_LO(c); + *(d++) = UTF8_EIGHT_BIT_HI((U8) c); + *(d++) = UTF8_EIGHT_BIT_LO((U8) c); Minor POD improvement
- Loading branch information
Michael Kröll
committed
Apr 20, 2016
1 parent
a9bcd95
commit 78d34cb
Showing
5 changed files
with
57 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!perl | ||
# https://github.com/xslate/p5-Text-Xslate/issues/88 | ||
use strict; | ||
use warnings; | ||
use Test::More; | ||
|
||
use utf8; | ||
use Text::Xslate 'mark_raw'; | ||
my $xslate = Text::Xslate->new(); | ||
|
||
is $xslate->render_string('<: $string :>', {string => "Ä"}) => 'Ä'; | ||
is $xslate->render_string('<: $string :>', {string => "\x{c4}"}) => 'Ä'; | ||
|
||
is $xslate->render_string('あ<: $string :>', {string => "Ä"}) => 'あÄ'; | ||
is $xslate->render_string('あ<: $string :>', {string => "\x{c4}"}) => 'あÄ'; | ||
|
||
is $xslate->render_string('<: $string :>', {string => mark_raw("Ä")}) => 'Ä'; | ||
is $xslate->render_string('<: $string :>', {string => mark_raw("\x{c4}")}) => 'Ä'; | ||
|
||
is $xslate->render_string('あ<: $string :>', {string => mark_raw("Ä")}) => 'あÄ'; | ||
is $xslate->render_string('あ<: $string :>', {string => mark_raw("\x{c4}")}) => 'あÄ'; | ||
|
||
done_testing(); |