diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2006-07-14 02:10:27 +0300 |
---|---|---|
committer | Steve Peters <steve@fisharerojo.org> | 2006-07-13 20:18:59 +0000 |
commit | cf0d1c66a0d97cdcc6938d91401fa36b9b5a67ac (patch) | |
tree | 65674c4cd5d583a2c89833405ac421a19c1387be /ext/Encode | |
parent | 2f3efc978ada94e3718bd6f3a25b06cd1d13b6f8 (diff) | |
download | perl-cf0d1c66a0d97cdcc6938d91401fa36b9b5a67ac.tar.gz |
z/OS: CPAN-ized ext/ and lib/
Message-ID: <44B6A8B3.5070605@iki.fi>
p4raw-id: //depot/perl@28568
Diffstat (limited to 'ext/Encode')
-rw-r--r-- | ext/Encode/Encode.xs | 3 | ||||
-rw-r--r-- | ext/Encode/t/utf8strict.t | 27 |
2 files changed, 21 insertions, 9 deletions
diff --git a/ext/Encode/Encode.xs b/ext/Encode/Encode.xs index 38e83dce5d..72a686ce39 100644 --- a/ext/Encode/Encode.xs +++ b/ext/Encode/Encode.xs @@ -481,7 +481,8 @@ CODE: /* Native bytes - can always encode */ U8 *d = (U8 *) SvGROW(dst, 2*slen+1); /* +1 or assertion will botch */ while (s < e) { - UV uv = NATIVE_TO_UNI((UV) *s++); + UV uv = NATIVE_TO_UNI((UV) *s); + s++; /* Above expansion of NATIVE_TO_UNI() is safer this way. */ if (UNI_IS_INVARIANT(uv)) *d++ = (U8)UTF_TO_NATIVE(uv); else { diff --git a/ext/Encode/t/utf8strict.t b/ext/Encode/t/utf8strict.t index b2bf6b39a0..37e771340f 100644 --- a/ext/Encode/t/utf8strict.t +++ b/ext/Encode/t/utf8strict.t @@ -40,14 +40,25 @@ BEGIN { 0x0000FFFF => 1, # 5.3.1 ); $NTESTS += scalar keys %ORD; - %SEQ = ( - qq/ed 9f bf/ => 0, # 2.3.1 - qq/ee 80 80/ => 0, # 2.3.2 - qq/f4 8f bf bf/ => 0, # 2.3.3 - qq/f4 90 80 80/ => 1, # 2.3.4 -- out of range so NG - # "3 Malformed sequences" are checked by perl. - # "4 Overlong sequences" are checked by perl. - ); + if (ord('A') == 193) { + %SEQ = ( + qq/dd 64 73 73/ => 0, # 2.3.1 + qq/dd 67 41 41/ => 0, # 2.3.2 + qq/ee 42 73 73 73/ => 0, # 2.3.3 + qq/f4 90 80 80/ => 1, # 2.3.4 -- out of range so NG + # "3 Malformed sequences" are checked by perl. + # "4 Overlong sequences" are checked by perl. + ); + } else { + %SEQ = ( + qq/ed 9f bf/ => 0, # 2.3.1 + qq/ee 80 80/ => 0, # 2.3.2 + qq/f4 8f bf bf/ => 0, # 2.3.3 + qq/f4 90 80 80/ => 1, # 2.3.4 -- out of range so NG + # "3 Malformed sequences" are checked by perl. + # "4 Overlong sequences" are checked by perl. + ); + } $NTESTS += scalar keys %SEQ; } use strict; |