Skip to content

Instantly share code, notes, and snippets.

@taiju
Last active August 29, 2015 13:57
Show Gist options
  • Select an option

  • Save taiju/9777776 to your computer and use it in GitHub Desktop.

Select an option

Save taiju/9777776 to your computer and use it in GitHub Desktop.
$ perl -Mojo -E 'b(shift)->slurp->decode("shift_jis")->encode("utf-8")->tap(sub { $$_ =~ s/((?:charset|encoding)\s*=\s*[\x{22}\x{27}]?)\s*(?:shift_jis|x-sjis|ms_kanji)/$1utf-8/gi })->spurt(shift)' test.html test.html.new
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment