Unicode in Perl, FTW (Я очень рад, ведь я, наконец, возвращаюсь домой)
Found on my hard drive. I love that it's source code that's literally in UTF-8 and it all just looks "right" or whatever that Russian says.
use utf8; use Encode 'encode'; print encode("ascii", 'Я очень рад, ведь я, наконец, возвращаюсь домой', sub{ sprintf "", shift });;
BTW:
russian says "i'm very happy since im returning home"
besides, this thing does not work in my environment (win xp), do you know why? it prints ???? ????, ??? ??
works only if
print encode("utf8" ...etc
It might not work for your environment if your terminal isn't properly set up for being UTF-8.