perl-unicode

Re: Comparing inputs with source strings

2016-05-11 19:51:33
Dear Karl,

I'm afraid that when it comes to normalization in Perl5, you have to
do it yourself.  I hear that Perl6 is much friendlier in this regard,
but I have no personal experience with it.  Your $unistring is in
whatever normalization you made it when you typed it into your editor,
or whatever your editor did with it as you were typing.  You could
have typed it in NFD, but probably the most natural way to enter
things on your keyboard will underlying it all be NFC.  

That's what I finally find out in another post, normally all my inputs
are NFD but my tests used static string to match, I declared them with
NFD to make it explicit.

I added a note in my POD to signal that the sub returns NFD strings.  

Could you use a source filter (man perlfilter)? That would run your script 
through an NFD converter before executing it.

Yours,
Martin

<Prev in Thread] Current Thread [Next in Thread>