Skip to content

Commit 6e8e0e8

Browse files
committed
perlguts: Update utf8_hop reference
utf8_hop_safe() solves the issues raised here
1 parent 505e049 commit 6e8e0e8

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

pod/perlguts.pod

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3552,9 +3552,8 @@ how long the first character in it is with the C<UTF8SKIP> macro:
35523552
len = UTF8SKIP(utf); /* len is 3 here */
35533553

35543554
Another way to skip over characters in a UTF-8 string is to use
3555-
C<utf8_hop>, which takes a string and a number of characters to skip
3556-
over. You're on your own about bounds checking, though, so don't use it
3557-
lightly.
3555+
L<perlapi/C<utf8_hop_safe>>, which takes a string and a number of
3556+
characters to skip over.
35583557

35593558
All bytes in a multi-byte UTF-8 character will have the high bit set,
35603559
so you can test if you need to do something special with this

0 commit comments

Comments
 (0)