Skip to content

Instantly share code, notes, and snippets.

@sergeyromanov
Created June 21, 2013 21:57
Show Gist options
  • Save sergeyromanov/5834660 to your computer and use it in GitHub Desktop.
Save sergeyromanov/5834660 to your computer and use it in GitHub Desktop.
potion issue
It seems that potion assumes that Unicode code points are 4 hex max:
sromanov@killdozer ~/mydev/potion $ cat example/unicode.pn
"I'm snowman - \u2603\n" print
"I'm bactrian - \u1f42b\n" print
sromanov@killdozer ~/mydev/potion $ bin/potion example/unicode.pn
I'm snowman - ☃
I'm bactrian - ὂb
Pumpkin perl gets this right (since 5.8.9, at least):
sromanov@killdozer ~/mydev/potion $ cat example/unicode.pl
binmode STDOUT, ":encoding(UTF-8)";
print "I'm snowman - \x{2603}\n";
print "I'm bactrian - \x{1f42b}\n";
sromanov@killdozer ~/mydev/potion $ perl example/unicode.pl
I'm snowman - ☃
I'm bactrian - 🐫
sromanov@killdozer ~/mydev/potion $ perl -le 'print $]'
5.008009
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment