in reply to Seeking Perl docs about how UTF8 flag propagates
My understanding has always been that the substring of a string should share its utf8'ness, and that once turned on it stays on until explicitly turned off. Anything else I consider a bug.
Having said that, it is good form to treat it as an uncertain value and when you need to care you should ensure the variable is the form you want/need. utf8::upgrade() and utf8::downgrade() and related function in Encode are your friend here. Just remember that while utf8::upgrade() should always work, utf8::downgrade() may not be possible and you may want to use utf8::encode() instead, depending on what you are doing.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Seeking Perl docs about how UTF8 flag propagates
by ikegami (Patriarch) on May 17, 2023 at 19:18 UTC | |
|
Re^2: Seeking Perl docs about how UTF8 flag propagates
by raygun (Scribe) on May 17, 2023 at 21:15 UTC |