That's wrong.
It doesn't "default to ASCII". It works against decoded text aka string of Unicode Code Points. Always. This can be demonstrated using "\N{U+100}" =~ /\w/ (which matches). You need to use /a if to limit it to the ASCII range.
Text encoded using ASCII happens to work because $x eq encode( "US-ASCII", $x ).
Text encoded using iso-latin-1 happens to work because $x eq encode( "iso-latin-1", $x ) (though do see last paragraph).
Those are just side effects of \w working on decoded text.
There was a bug where \w didn't work for characters in U+0080..U+00FF sometimes. This was fixed 12 years ago in 2011. Add use v5.14; to get the fix.
In reply to Re^12: Seeking Perl docs about how UTF8 flag propagates (Terminology)
by ikegami
in thread Seeking Perl docs about how UTF8 flag propagates
by raygun
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |