Hacker News new | ask | show | jobs
by draegtun 4945 days ago
This is very thorough boilerplate code for dealing with all corner cases when using utf-8 data with Perl.

Instead of dismissing or dissing Tom Christiansen excellent post I would highly recommend reading into his The Good, the Bad, & the (mostly) Ugly presentation from OSCON 2011 [1] where he compares Unicode handling across mainstream languages and then see how this code (and Perl) shapes up in comparison.

In the meantime pragmatic Perl programmers can cover most of that utf-8 boilerplate with just:

  use 5.016;
  use warnings;
  use utf8::all;
Or if you're like me and use perl5i [2] then its just:

  use perl5i::2;

[1]: http://training.perl.com/OSCON2011/index.html

[2]: https://metacpan.org/module/perl5i