develooper Front page | perl.cvs.parrot | Postings from November 2008

[svn:parrot] r33392 - branches/pdd22io_part2/t/op

From:
allison
Date:
November 30, 2008 17:54
Subject:
[svn:parrot] r33392 - branches/pdd22io_part2/t/op
Message ID:
20081201015433.626B5CB9AF@x12.develooper.com
Author: allison
Date: Sun Nov 30 17:54:31 2008
New Revision: 33392

Modified:
   branches/pdd22io_part2/t/op/string_cs.t

Log:
[pdd22io] Update old way of setting UTF-8 encoding on filehandle.


Modified: branches/pdd22io_part2/t/op/string_cs.t
==============================================================================
--- branches/pdd22io_part2/t/op/string_cs.t	(original)
+++ branches/pdd22io_part2/t/op/string_cs.t	Sun Nov 30 17:54:31 2008
@@ -490,16 +490,18 @@
 
 SKIP: {
     skip( 'no ICU lib', 16 ) unless $PConfig{has_icu};
-    pasm_output_is( <<'CODE', <<"OUTPUT", "unicode downcase" );
-    set S0, iso-8859-1:"T�TSCH"
-    find_charset I0, "unicode"
-    trans_charset S1, S0, I0
-    downcase S1
-    getstdout P0          # need to convert back to utf8
-    push P0, "utf8"       # push utf8 output layer
-    print S1
+    pir_output_is( <<'CODE', <<"OUTPUT", "unicode downcase" );
+.sub main :main
+    set $S0, iso-8859-1:"T�TSCH"
+    find_charset $I0, "unicode"
+    trans_charset $S1, $S0, $I0
+    downcase $S1
+    getstdout $P0           # need to convert back to utf8
+    $P0.'encoding'("utf8")  # set utf8 output
+    print $S1
     print "\n"
     end
+.end
 CODE
 t\xc3\xb6tsch
 OUTPUT
@@ -690,28 +692,32 @@
 6
 OUTPUT
 
-    pasm_output_is( <<'CODE', <<"OUTPUT", "unicode upcase" );
-    set S0, iso-8859-1:"t�tsch"
-    find_charset I0, "unicode"
-    trans_charset S1, S0, I0
-    upcase S1
-    getstdout P0          # need to convert back to utf8
-    push P0, "utf8"       # push utf8 output layer
-    print S1
+    pir_output_is( <<'CODE', <<"OUTPUT", "unicode upcase" );
+.sub main :main
+    set $S0, iso-8859-1:"t�tsch"
+    find_charset $I0, "unicode"
+    trans_charset $S1, $S0, $I0
+    upcase $S1
+    getstdout $P0         # need to convert back to utf8
+    $P0.'encoding'("utf8") # set utf8 output
+    print $S1
     print "\n"
     end
+.end
 CODE
 T\x{c3}\x{96}TSCH
 OUTPUT
 
-    pasm_output_is( <<'CODE', <<"OUTPUT", "unicode upcase to combined char" );
-    set S1, unicode:"hacek j \u01f0"
-    upcase S1
-    getstdout P0          # need to convert back to utf8
-    push P0, "utf8"       # push utf8 output layer
-    print S1
+    pir_output_is( <<'CODE', <<"OUTPUT", "unicode upcase to combined char" );
+.sub main :main
+    set $S1, unicode:"hacek j \u01f0"
+    upcase $S1
+    getstdout $P0          # need to convert back to utf8
+    $P0.'encoding'("utf8") # set utf8 output
+    print $S1
     print "\n"
     end
+.end
 CODE
 HACEK J J\xcc\x8c
 OUTPUT
@@ -732,54 +738,60 @@
     # (gdb) x /8h src->strstart
     # 0x844fb60:      0x005f  0x005f  0x005f  0x004a  0x030c  0x0031  0x0032  0x0000
 
-    pasm_output_is( <<'CODE', <<"OUTPUT", "unicode upcase to combined char 3.2 bug?" );
-    set S1, unicode:"___\u01f0123"
-    upcase S1
-    getstdout P0          # need to convert back to utf8
-    push P0, "utf8"       # push utf8 output layer
-    print S1
+    pir_output_is( <<'CODE', <<"OUTPUT", "unicode upcase to combined char 3.2 bug?" );
+.sub main :main
+    set $S1, unicode:"___\u01f0123"
+    upcase $S1
+    getstdout $P0          # need to convert back to utf8
+    $P0.'encoding'("utf8") # set utf8 output
+    print $S1
     print "\n"
     end
+.end
 CODE
 ___J\xcc\x8c123
 OUTPUT
 
-    pasm_output_is( <<'CODE', <<"OUTPUT", "unicode titlecase" );
-    set S0, iso-8859-1:"t�tsch leo"
-    find_charset I0, "unicode"
-    trans_charset S1, S0, I0
-    titlecase S1
-    getstdout P0          # need to convert back to utf8
-    push P0, "utf8"       # push utf8 output layer
-    print S1
+    pir_output_is( <<'CODE', <<"OUTPUT", "unicode titlecase" );
+.sub main :main
+    set $S0, iso-8859-1:"t�tsch leo"
+    find_charset $I0, "unicode"
+    trans_charset $S1, $S0, $I0
+    titlecase $S1
+    getstdout $P0          # need to convert back to utf8
+    $P0.'encoding'("utf8") # set utf8 output
+    print $S1
     print "\n"
     end
+.end
 CODE
 T\x{c3}\x{b6}tsch Leo
 OUTPUT
 
-    pasm_output_is( <<'CODE', <<OUTPUT, "combose combined char" );
-    set S1, unicode:"___\u01f0___"
-    length I0, S1
-    upcase S1        # decompose J+hacek
-    length I1, S1    # 1 longer
-    downcase S1      # j+hacek
-    length I2, S1
-    compose S1, S1
-    length I3, S1    # back at original string
-    getstdout P0          # need to convert back to utf8
-    push P0, "utf8"       # push utf8 output layer
-    print S1
+    pir_output_is( <<'CODE', <<OUTPUT, "combose combined char" );
+.sub main :main
+    set $S1, unicode:"___\u01f0___"
+    length $I0, $S1
+    upcase $S1         # decompose J+hacek
+    length $I1, $S1    # 1 longer
+    downcase $S1       # j+hacek
+    length $I2, $S1
+    compose $S1, $S1
+    length $I3, $S1        # back at original string
+    getstdout $P0          # need to convert back to utf8
+    $P0.'encoding'("utf8") # set utf8 output
+    print $S1
     print "\n"
-    print I0
+    print $I0
     print ' '
-    print I1
+    print $I1
     print ' '
-    print I2
+    print $I2
     print ' '
-    print I3
+    print $I3
     print "\n"
     end
+.end
 CODE
 ___\x{c7}\x{b0}___
 7 8 8 7



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About