Skip to content

Instantly share code, notes, and snippets.

@tkusano
Created October 14, 2010 15:52
Show Gist options
  • Save tkusano/626435 to your computer and use it in GitHub Desktop.
Save tkusano/626435 to your computer and use it in GitHub Desktop.
#! /usr/bin/perl
##
## Convert EmojiSources.txt to UTF-8 text
##
use strict;
use warnings;
binmode STDOUT, ':utf8';
my $column = 0;
while (<>) {
chomp;
if ( /^\043/ || /^\s*$/ ) {
next;
}
my ( $unicode_sequence, $docomo, $kddi, $sb ) = split /;/;
foreach my $code ( split /\s/, $unicode_sequence ) {
my $char = chr( hex($code) );
print $char;
}
$column++;
if ( $column >= 32 ) {
print "\n";
$column = 0;
}
}
print "\n";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment