in reply to Re^3: Memory Leak with XS but not pure C
in thread Memory Leak with XS but not pure C
uc suffers from The Unicode Bug when the unicode_strings feature isn't in enabled.
It works correctly (giving SS for ß) when the string the unicode_strings feature is enabled.
It works correctly (giving SS for ß) when the string is stored in the UTF8=1 format.
It works incorrectly (ß unchanged) otherwise.
use open ":std", ":locale"; use feature qw( say ); my $ss = "\xDF"; utf8::upgrade( my $ss_u = $ss ); utf8::downgrade( my $ss_d = $ss ); { no feature qw( unicode_strings ); say uc( $ss_d ); # ß say uc( $ss_u ); # SS } { use feature qw( unicode_strings ); say uc( $ss_d ); # SS say uc( $ss_u ); # SS }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^5: Memory Leak with XS but not pure C
by FrankFooty (Novice) on Mar 31, 2025 at 10:21 UTC | |
by syphilis (Archbishop) on Mar 31, 2025 at 12:29 UTC | |
by ikegami (Patriarch) on Mar 31, 2025 at 13:20 UTC | |
by ikegami (Patriarch) on Mar 31, 2025 at 13:18 UTC |