Zeno's Notes


Posts tagged Perl

0 notes

Unicode-aware Perl one-liners

tr does not support UTF-8 out of the box, neither does Perl.

So what if you consistently want to change the case of text that you are processing?

In contrast to tr, you can talk Perl into properly dealing with all kinds of UTF-8 characters:

echo ‘ÄC/DC Ñ’ | perl “-Mopen qw/:std :utf8/” -pe ‘$_=lc’


äc/dc ñ


echo ‘ßčňřšžæøåáéíóúàèìòùâêîôûçşłąęįǫųćśźżãẽĩõũ’ | perl “-Mopen qw/:std :utf8/” -pe ‘$_=uc’



The first one-liner turns everything into lower case, using Perl’s built-in lc function, while the second one turns everything into upper case, using uc.

Hat tip to user potyl on StackOverflow, who gave a nice answer to the question on how to properly use UTF-8 with the diamond operator. So I only had to transfer the statement

use open qw/:std :utf8/;

to the command line argument

"-Mopen qw/:std :utf8/"

Filed under perl one-liner unicode encoding lower case upper case lc uc tr tricks command-line unix text text processing

3 notes

Does open source exclude high context cultures?

Interesting piece about the threshold for contributors from different cultures.

Also some good comments, e.g. from Donnie Berkholz:

… the same things important to increasing contribution from high-context cultures are *also* important to recruiting and retaining contributors in low-context cultures. Relationships and integration into the community trumps everything.

I fully agree. The Padre project is doing things the right way here. There is a Code of Conduct and a Diversity Statement, the community is open and welcoming, development is public and transparent, developers are spread around the globe (Germany, Israel, Jordan, Australia, Turkey, the Netherlands, Brazil, France …) and people from the project (in particular Gabor) go to events and talk to people in person regularly. And that makes a difference. A lot. I think I use Padre exactly because I met Gabor and Sebastian (sewi) last year at CeBIT and they got me interested again in that nice editor/IDE thing …

So guys, keep up the good work, both on the code and the community.

Filed under culture relationships open source free software padre perl IDE editor community