It’s quite unclear what it is that you really want here. It doesn’t make much sense to run a text sort on nontextual data, which is what control characters are. Why should invisible characters make any difference to how text sorts? They shouldn’t. The whole point of the UCA is that it does not behave like a text-ignorant code-point sort; it’s a text sort, which is a completely different beastie. What you’ve showed seems completely correct to me, so I don’t understand what you want.

I suppose that it is perhaps possible that you may wish to change the weighting of the variably-weighted elements such that they are not ignored the first time around. The constructor’s variable named-argument accepts four possible values to alter how otherwise-ignored code points are to be treated. Per the manpage:

blanked
Variable elements are made ignorable at levels 1 through 3; considered at the 4ᵗʰ level.
non-ignorable
Variable elements are not reset to ignorable.
shifted
Variable elements are made ignorable at levels 1 through 3 their level 4 weight is replaced by the old level 1 weight. Level 4 weight for Non-Variable elements is 0xFFFF.
shift-trimmed
Same as shifted, but all FFFF’s at the 4ᵗʰ level are trimmed.
So perhaps variable => "non-ignorable" might be more to your liking, or one of the other three possible settings.

You may also want to set upper_before_lower => 1.


In reply to Re: RFC: Is this the correct use of Unicode::Collate? by tchrist
in thread RFC: Is this the correct use of Unicode::Collate? by flexvault

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.