diff options
author | Karl Williamson <public@khwilliamson.com> | 2012-03-19 10:52:25 -0600 |
---|---|---|
committer | Karl Williamson <public@khwilliamson.com> | 2012-03-19 18:23:43 -0600 |
commit | 95701e00f8e747fe1c24564cb038be375695df5a (patch) | |
tree | 9a2e5cab3d0177782fe0cc457034e199e8d5683a | |
parent | 8752e5a8bd5a13883a0909d80ec0e205f71f8dbd (diff) | |
download | perl-95701e00f8e747fe1c24564cb038be375695df5a.tar.gz |
perlguts, warnings.t: Update references to obsolete fcn names
These functions were replaced long ago, apparently in 5.8, but I didn't
verify that for sure.
-rw-r--r-- | pod/perlguts.pod | 13 | ||||
-rw-r--r-- | t/lib/warnings/utf8 | 4 |
2 files changed, 9 insertions, 8 deletions
diff --git a/pod/perlguts.pod b/pod/perlguts.pod index e585171f90..ee938ea137 100644 --- a/pod/perlguts.pod +++ b/pod/perlguts.pod @@ -2671,21 +2671,22 @@ whether the byte can be encoded as a single byte even in UTF-8): U8 *utf; UV uv; /* Note: a UV, not a U8, not a char */ + STRLEN len; /* length of character in bytes */ if (!UTF8_IS_INVARIANT(*utf)) /* Must treat this as UTF-8 */ - uv = utf8_to_uv(utf); + uv = utf8_to_uvchr(utf, &len); else /* OK to treat this character as a byte */ uv = *utf; -You can also see in that example that we use C<utf8_to_uv> to get the -value of the character; the inverse function C<uv_to_utf8> is available +You can also see in that example that we use C<utf8_to_uvchr> to get the +value of the character; the inverse function C<uvchr_to_utf8> is available for putting a UV into UTF-8: if (!UTF8_IS_INVARIANT(uv)) /* Must treat this as UTF8 */ - utf8 = uv_to_utf8(utf8, uv); + utf8 = uvchr_to_utf8(utf8, uv); else /* OK to treat this character as a byte */ *utf8++ = uv; @@ -2791,13 +2792,13 @@ it's not - if you pass on the PV to somewhere, pass on the flag too. =item * -If a string is UTF-8, B<always> use C<utf8_to_uv> to get at the value, +If a string is UTF-8, B<always> use C<utf8_to_uvchr> to get at the value, unless C<UTF8_IS_INVARIANT(*s)> in which case you can use C<*s>. =item * When writing a character C<uv> to a UTF-8 string, B<always> use -C<uv_to_utf8>, unless C<UTF8_IS_INVARIANT(uv))> in which case +C<uvchr_to_utf8>, unless C<UTF8_IS_INVARIANT(uv))> in which case you can use C<*s = uv>. =item * diff --git a/t/lib/warnings/utf8 b/t/lib/warnings/utf8 index 7d3886c388..608f198fb9 100644 --- a/t/lib/warnings/utf8 +++ b/t/lib/warnings/utf8 @@ -1,7 +1,7 @@ utf8.c AOK - [utf8_to_uv] + [utf8_to_uvchr] Malformed UTF-8 character my $a = ord "\x80" ; @@ -14,7 +14,7 @@ <<<<<< Add a test when something actually calls utf16_to_utf8 __END__ -# utf8.c [utf8_to_uv] -W +# utf8.c [utf8_to_uvchr] -W BEGIN { if (ord('A') == 193) { print "SKIPPED\n# ebcdic platforms do not generate Malformed UTF-8 warnings."; |