How do you sort Chinese, Japanese and Korean (CJK) characters in Perl?
As far as I can tell, sorting CJK characters by stroke count, then by radical, seems to be the way these languages are sorted. There are also some methods that sort by sounds, but this seems less common.
I've tried using:
perl -e 'print join(" ", sort qw(工 然 一 人 三 古 二 )), "\n";'
# Prints: 一 三 二 人 古 工 然 which is incorrect
And I've tried using Unicode::Collate from CPAN, but it says:
By default, CJK Unified Ideographs are ordered in Unicode codepoint order...
If I could get a database of stroke count per character, I could easily sort all of the characters, but this doesn't seem to come with Perl nor is it encapsulated in any module I could find.
If you know how to sort CJK in other languages, it would be helpful to mention it in an answer to this question.