Skip to content

Instantly share code, notes, and snippets.

@kurahaupo
Created January 3, 2014 00:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kurahaupo/8229858 to your computer and use it in GitHub Desktop.
Save kurahaupo/8229858 to your computer and use it in GitHub Desktop.
Convert normal ascii to equivalent double-width unicode characters
#!/usr/bin/perl
use utf8;
binmode STDOUT, ":utf8";
while (<>) {
s/ / /g;
s/\t/\t\t/g;
s/[!-~]/chr(ord($&)+0xff00-0x20)/xge;
print $_;
}
1;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment