直至今日看到了這篇:wine 中文問題【新解決方案】【高手進】找了一下到底問題出在那
第一條跟第四條無法正確顯示 |
Convert Hex to ASCII
od + xxd
echo 字串| xxd -r -p
範例
echo 2f,75,73,72,2f,73,68,61,72,65,2f,66,6f,6e,74,73,2f,77,65,6e,71,75,61,6e,79,69,2f,77,71,79,2d,6d,69,63,72,6f,68,65,69,2f,77,71,79,2d,6d,69,63,72,6f,68,65,69,2e,74,74,63,0a| xxd -r -p
/usr/share/fonts/wenquanyi/wqy-microhei/wqy-microhei.ttc
Convert ASCII to Hex
echo 字串|od -tx1 |cut -c8-|tr -d '\n'
範例
Convert ASCII to Hex(改成Windows機碼樣式)
echo /usr/share/fonts/wenquanyi/wqy-microhei/wqy-microhei.ttc|od -tx1 |cut -c8-|tr -d '\n'
2f 75 73 72 2f 73 68 61 72 65 2f 66 6f 6e 74 73 2f 77 65 6e 71 75 61 6e 79 69 2f 77 71 79 2d 6d 69 63 72 6f 68 65 69 2f 77 71 79 2d 6d 69 63 72 6f 68 65 69 2e 74 74 63 0a
最後把機碼改回正確的路徑文字就能正常顯示了,想知道我怎麼改的就看原文囉。
範例 hexdump + xxd
echo /usr/share/fonts/wenquanyi/wqy-microhei/wqy-microhei.ttc|hexdump -v -e '1/1 "%02X,"'
2F,75,73,72,2F,73,68,61,72,65,2F,66,6F,6E,74,73,2F,77,65,6E,71,75,61,6E,79,69,2F,77,71,79,2D,6D,69,63,72,6F,68,65,69,2F,77,71,79,2D,6D,69,63,72,6F,68,65,69,2E,74,74,63,0A,
echo
2F,75,73,72,2F,73,68,61,72,65,2F,66,6F,6E,74,73,2F,77,65,6E,71,75,61,6E,79,69,2F,77,71,79,2D,6D,69,63,72,6F,68,65,69,2F,77,71,79,2D,6D,69,63,72,6F,68,65,69,2E,74,74,63,0A,|xxd -r -p
/usr/share/fonts/wenquanyi/wqy-microhei/wqy-microhei.ttc都能正常顯示 |