Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Rename MacOS X NFD hangule to NFC
#!/usr/bin/env perl
# 사용법
# perl demacboogi.pl *.zip #zip파일만 변환
# perl demacboogi.pl #모든파일 변환
use 5.010;
use strict;
use warnings;
use Encode qw/encode decode/;
use Unicode::Normalize qw/compose/;
use File::Copy;
my @files = @ARGV;
@files = glob('*') if @files == 0;
foreach my $file (@files) {
my $from = decode('utf8', $file);
my $to = compose($from);
if ($from ne $to) {
say encode('utf8', "move $from -> $to");
move($from, $to);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.