Created
February 15, 2017 01:23
-
-
Save roycewilliams/8607cf34f6be53d58c22f34cc6bbec1c to your computer and use it in GitHub Desktop.
hex2utf8.pl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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