Author: chromatic Date: Mon Jan 19 13:11:03 2009 New Revision: 35772 Modified: trunk/src/string.c trunk/src/string_primitives.c trunk/t/op/stringu.t
Log: [src] Added a test for TT #24, where \xab escapes in literal PIR don't work correctly for iso-8859-1 encoding. Modified: trunk/src/string.c ============================================================================== --- trunk/src/string.c (original) +++ trunk/src/string.c Mon Jan 19 13:11:03 2009 @@ -1500,8 +1500,8 @@ else if (!s1->strlen) { /* s2->strlen is the same here */ return 0; } - else if (s1->strstart == s2->strstart && - s1->bufused == s2->bufused) { /* COWed strings */ + /* COWed strings */ + else if (s1->strstart == s2->strstart && s1->bufused == s2->bufused) { return 0; } Modified: trunk/src/string_primitives.c ============================================================================== --- trunk/src/string_primitives.c (original) +++ trunk/src/string_primitives.c Mon Jan 19 13:11:03 2009 @@ -85,12 +85,14 @@ ARGMOD(STRING *string)) { ASSERT_ARGS(string_unescape_one) - UINTVAL workchar = 0; + UINTVAL workchar = 0; UINTVAL charcount = 0; const UINTVAL len = string_length(interp, string); + /* Well, not right now */ UINTVAL codepoint = CHARSET_GET_BYTE(interp, string, *offset); ++*offset; + switch (codepoint) { case 'x': codepoint = CHARSET_GET_BYTE(interp, string, *offset); Modified: trunk/t/op/stringu.t ============================================================================== --- trunk/t/op/stringu.t (original) +++ trunk/t/op/stringu.t Mon Jan 19 13:11:03 2009 @@ -1,12 +1,12 @@ #!perl -# Copyright (C) 2001-2007, The Perl Foundation. +# Copyright (C) 2001-2009, The Perl Foundation. # $Id$ use strict; use warnings; use lib qw( . lib ../lib ../../lib ); use Test::More; -use Parrot::Test tests => 26; +use Parrot::Test tests => 27; use Parrot::Config; =head1 NAME @@ -435,6 +435,23 @@ OUTPUT } +pasm_output_is( <<'CODE', <<OUTPUT, "UTF-8 and Unicode literals", todo => 'TT #24' ); + set S0, unicode:"\u00ab" + length I0, S0 + say I0 + say S0 + set S0, iso-8859-1:"\xab" + length I0, S0 + say I0 + say S0 + end +CODE +1 +\xc2\xab +1 +\xc2\xab +OUTPUT + # Local Variables: # mode: cperl # cperl-indent-level: 4