The only correct approach for UTF-8 strings in Perl.
A string is treated as byte sequences without any flags.
Separate functions that handle UTF-8 from functions that handle byte sequences. The following is an example of the substr
function.
substr_bytes
substr_utf8
The use utf8_func
pragma replaces substr
with substr_utf8
.
The use bytes_func
pragma replaces substr
with substr_bytes
.
Feel free to comment.
Top comments (2)
So what would happen if you say neither
use utf8_func
noruse bytes_func
?And how is
use bytes_func
different fromuse bytes
?what are the tags for French?