2009年12月19日

在Linux下用native2ascii轉成簡中unicode的方式

在JDK安裝目錄中BIN底下有一個轉碼工具native2ascii.exe
資源文件需要進行Unicode編碼,方法是使用這個jdk提供的工具來轉換native2ascii

ascii到unicode方式:
native2ascii 原檔名 轉換檔名

因為我用的是繁體中文的環境, 首先, 必需將自己的locale換成zh_CN
export LC_ALL=zh_CN.utf8
然後再執行gnome-editor將翻譯成簡中的文字貼上
最後再執行native2ascii即可

範例
aaa.txt文件內容包括:中國
native2ascii aaa.txt bbb.txt
執行後變為:\u4e2d\u56fd

aaa.txt文件內容包括:\u4e2d\u56fd
native2ascii -reverse aaa.txt bbb.txt
執行後變為:中國

沒有留言:

coap-client 4.3.0 Windows build

coap-client  is a  wget -like tool to generate simple requests for retrieval and modification of resources on a remote server.  Got the sour...