I decided to do this because Perl's unicode support is very difficult to work properly.
This value is Ι΄α΄α΄ true!
Perl has the most powerful Unicode support of any major programming language. It is much easier to work with Unicode if you use Perl than if you used any C, C ++ Java, C β― Python, Ruby, PHP or Javascript. This is not hyperbole and boosterism from uneducated, blind fidelity .; it is a valued assessment based on more than a decade of professional experience and study.
The problems that naive users face are almost always related to the fact that they tricked themselves into what Unicode is. Worst brain-error number one thinks Unicode is similar to ASCII, but more. This is absolutely and completely wrong. As I wrote elsewhere:
It is fundamentally and critically not true that UΙ΄Ιͺα΄α΄α΄
α΄ is just some extended character set with respect to α΄sα΄ΙͺΙͺ. At best, thatβs nothing more than the stunning Ιͺsα΄-10646. UΙ΄Ιͺα΄α΄α΄
α΄ includes much more that just assigning numbers to glyphs: sorting and matching rules, three casing shapes, a non-letter wrapper, multi-code examples, both canonical and compatible folded and unfolded shape normalization, serialization forms, grapheme clusters, word breaks and lines, scripts, numerical equivalents, widths, bidirectionality, mirroring, print width, exclusion of logical ordering, glyph options, contextual behavior, locales, regular expressions, several forms of concatenation as the class, multiple types of expansions, hundreds critically useful features and much more!
Yes, this is a lot, but it has nothing to do with Perl. This is due to Unicode. This Perl allows you to access these things when you are working with Unicode, not a bug, but a function. The fact that these other languages ββdo not allow you to get full access to Unicode can in no way be interpreted as a point in their favor: rather, these are all the main mistakes with the highest possible seriousness, because if you cannot work with Unicode in the 21st century , then this language is primitive, broken and fundamentally useless for the demanding requirements of modern text processing.
Perl is not. And simpler than simpler than in other languages, it's easier to do in Perl. in most of them you canβt even start working on your design flaws. You are just screwed. If the language does not provide full Unicode support, it is not suitable for this century; discard him.
Perl makes Unicode infinitely simpler than languages ββthat prevent Unicode from being used properly.
In this answer, you will find on the first page Seven simple steps for working with Unicode in Perl and at the bottom of the same answer you will find some code templates that will help. Understand this, then use it. Do not accept the violation. You need to learn Unicode before you can use Unicode.
And that is why there is no easy answer. Perl simplifies Unicode, provided that you understand what Unicode is. And if you are dealing with external sources, you need to organize some kind of encoding for this source.
Also read everything I said about πΈπ€π€π¦ππ πΉπ£π ππππππ€π€. This is what you really need to understand. Another breakdown problem that drops out of Rule # 49 is that Javascript is corrupted because it does not handle all valid Unicode code points in exactly the same way, regardless of their plane. Javascript is broken in almost all other ways. This is not suitable for Unicode. Just Rule # 34 will kill you, since you cannot get Javascript to follow the standard that things like \w are defined in Unicode regexes .
It's amazing how many languages ββare completely useless for Unicode. But Perl is most definitely not one of them!