in reply to Unicode Golf

Here's a somewhat shorter way of doing it in Perl: perl -ne'printf"U+%04X ",$_ for unpack"U*",$_' infile.txt (For Windows, change the single quotes to double quotes, and vice versa.)