Skip to content

Instantly share code, notes, and snippets.

@unot
Created May 30, 2011 01:29
Show Gist options
  • Save unot/998339 to your computer and use it in GitHub Desktop.
Save unot/998339 to your computer and use it in GitHub Desktop.
CAPになってしまったファイル名をUTF-8に修正
#! /bin/sh
#
find . -name "*:*" | while read CAPNAME
do
UTFNAME=`echo $CAPNAME | perl -MEncode -pane 's/:[0-9a-fA-F]{2})/chr(hex($1))/ge; Encode::from_to($_, "shiftjis", "utf8");'`
cp -R "$CAPNAME" "$UTFNAME" && rm "$CAPNAME"
done
#find . -name "*:*" -exec rm -rf {} \;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment