Skip to content

Instantly share code, notes, and snippets.

@sueharaluke
Last active August 18, 2021 06:23
Show Gist options
  • Save sueharaluke/d6d3b65454fbdd9a1d21234c142028b6 to your computer and use it in GitHub Desktop.
Save sueharaluke/d6d3b65454fbdd9a1d21234c142028b6 to your computer and use it in GitHub Desktop.
Batch update encoding (ubuntu)
// Install nkf
$ sudo apt install nkf
// Batch update all .html files inside current directory
// To UTF-8
$ find . -type f -name "*.html" -exec nkf -w --overwrite {} \;
// To SHIFT_JIS 半角が全角になる
$ find . -type f -name "*.html" -exec nkf -s --overwrite {} \;
// To SHIFT_JIS 半角がそのままでいい
$ find . -type f -name "*.html" -exec nkf -s -x --overwrite {} \;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment