Skip to content

Instantly share code, notes, and snippets.

@koba04
Created September 21, 2010 10:06
Show Gist options
  • Save koba04/589499 to your computer and use it in GitHub Desktop.
Save koba04/589499 to your computer and use it in GitHub Desktop.
// escape
javascript:var d = document;d.open();d.write(escape("変換したい文字列").replace(/%/g, "\\"));d.close();
// => \u5909\u63DB\u3057\u305F\u3044\u6587\u5B57\u5217
// unescape
javascript:var d = document;d.open();d.write(unescape("\u5909\u63DB\u3057\u305F\u3044\u6587\u5B57\u5217"));d.close();
// => 変換したい文字列
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment