Skip to content

Instantly share code, notes, and snippets.

@roycewilliams
Created February 15, 2017 01:23
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 roycewilliams/8607cf34f6be53d58c22f34cc6bbec1c to your computer and use it in GitHub Desktop.
Save roycewilliams/8607cf34f6be53d58c22f34cc6bbec1c to your computer and use it in GitHub Desktop.
hex2utf8.pl
#!/usr/bin/perl -CS
# Purpose: convert Unicode hex code points to utf-8.
# Created: 2017-02-12
use strict;
use warnings;
use utf8;
use open ':std', ':encoding(UTF-8)';
#use open IO => q{:bytes};
while (<>) {
chomp;
my $hex_string = '0x' . $_;
my $hex = hex($hex_string);
print chr $hex;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment