1. JavaScriptファイル作成
native2ascii.js
// 全選択
if(Editor.IsTextSelected() == 0) { Editor.SelectAll(); }
// 文字列を取得
var ret = Editor.GetSelectedString(0); ret = escape(ret);
// エンコード 4 桁 %u → \u
ret = ret.replace(/%(u[0-9a-fA-F]{4})/g, "\$1");
// デコード
ret = unescape(ret);
// 結果
Editor.InsText(ret);
2.実行手順
![](http://itbibo.starfree.jp/wp-content/themes/cocoon-child-master/images/js/sakura/native2ascii-1.jpg)
![](http://itbibo.starfree.jp/wp-content/themes/cocoon-child-master/images/js/sakura/native2ascii-2.jpg)
![](http://itbibo.starfree.jp/wp-content/themes/cocoon-child-master/images/js/sakura/native2ascii-3.jpg)