Skip to content

Instantly share code, notes, and snippets.

@jongyeol
Created November 27, 2017 06:55
Show Gist options
  • Save jongyeol/c30a4a0cf7420a3dd8ed9faad3433a08 to your computer and use it in GitHub Desktop.
Save jongyeol/c30a4a0cf7420a3dd8ed9faad3433a08 to your computer and use it in GitHub Desktop.
nfc-nfd
#!/usr/bin/env perl
use 5.010;
use strict;
use warnings;
use Encode qw/encode decode/;
use Unicode::Normalize qw/compose/;
while(<>) {
my $line = compose(decode('utf8',$_));
print encode('utf8',$line);
}
#!/usr/bin/env perl
use 5.010;
use strict;
use warnings;
use Encode qw(encode decode);
use Unicode::Normalize qw(compose normalize);
binmode STDOUT, ':encoding(UTF-8)';
while(<>) {
my $line = normalize('D',decode('utf8',$_));
print $line;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment