The only correct approach for UTF-8 strings in Perl
Yuki Kimoto

Yuki Kimoto @yukikimoto

About: I'm developing SPVM programing language and GitPrep now. Facebook https://www.facebook.com/profile/61550470287438

Location:
Japan/Tokyo
Joined:
Mar 8, 2021

The only correct approach for UTF-8 strings in Perl

Publish Date: May 26 '23
1 2

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
Enter fullscreen mode Exit fullscreen mode

The use utf8_func pragma replaces substr with substr_utf8.

The use bytes_func pragma replaces substr with substr_bytes.

Feel free to comment.

Comments 2 total

  • Aristotle Pagaltzis
    Aristotle PagaltzisMay 26, 2023

    So what would happen if you say neither use utf8_func nor use bytes_func?

    And how is use bytes_func different from use bytes?

  • RawHide81
    RawHide81Nov 16, 2023

    what are the tags for French?

Add comment