Re:Perl 6 Introduction
by gdwatson on Saturday November 28, 2015 @06:32PM
(#10642998)
Grapheme-cluster strings are neat, and the decision to normalize makes sense in that context. But how does Perl 6 handle filenames, which can't be safely round-tripped through grapheme strings?
[ Parent
| on HN ]
It turns out that the same NFG mechanism developed to support graphemes works for this non-grapheme scenario too:
"... POSIX doesn’t promise you’ll get UTF-8, or even ASCII. It promises ... a bunch of bytes. We can now cope with this properly – surprisingly enough, thanks to the power of NFG. We now have a special encoding, UTF-8 Clean-8-bit, which turns bytes that are invalid as UTF-8 into synthetics, from which we can recover the original bytes again at output. This means that any filename, environment variable, and so forth can be roundtripped through Perl 6 problem-free. You can concat “.bak” onto the end of such a string, and it’ll still work out just fine."
From https://6guts.wordpress.com/2015/11/21/what-one-christmas-el...