jdk 自帶中文轉unicode碼工具

命令提示符模式進入java的bin目錄,執行命令:

native2ascii.exe -encoding gb2312 source.properties target.txt

此命令將源文件source.properties中的中文字符轉碼後保存到target.txt中。

如:
source.properties文件內容爲:中國

native2ascii.exe -encoding gb2312 source.properties target.txt

執行後target.txt中會顯示:\u4e2d\u56fd
發佈了34 篇原創文章 · 獲贊 2 · 訪問量 4萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章