Skip to content

Instantly share code, notes, and snippets.

@SuibianP
Last active October 25, 2020 06:32
Show Gist options
  • Save SuibianP/47a9a0c6106798a737b6cda28bf4e4ea to your computer and use it in GitHub Desktop.
Save SuibianP/47a9a0c6106798a737b6cda28bf4e4ea to your computer and use it in GitHub Desktop.
Shell script resolution for garbled Chinese-encoded Japanese UTAU voicebanks
#!/bin/sh
for f in ./*
do
mv $f `echo $f | iconv -f UTF-8 -t GBK | iconv -f shift-jis -t UTF-8`
done
@SuibianP
Copy link
Author

Or a one-liner that can be directly executed, of course
for f in ./*; do mv $f `echo $f | iconv -f UTF-8 -t GBK | iconv -f shift-jis -t UTF-8`; done

This method works well with filenames in the mojibake form of _偁偁偄偁偆偊偁.wav.
The reason for not using convmv is that it does not accept the nonsense produced in the middle of the conversion.
I find this way works kind of more elegant than 菲菲更名宝贝.
Please do test out the result of iconv command before the actual conversion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment