Convert a string to utf-8 (hex) with command
echo -n '淵' | od -An -tx1 -w65536 | tr '[:lower:]' '[:upper:]' | sed 's/ /\\x/g'
-
od 參數說明:
-An: 不顯示第一列偏移位置
-tx1: 以十六進制輸出顯示,每列輸出一個一個字節(位元組/Byte)
-w65536: 每列顯示 65536 個字節(位元組/Byte) -
tr 參數說明: 單引號內語法表示將小寫字元轉換成大寫字元
-
sed 參數說明: 單引號內語法表示將空格取代為 "\x" (若想轉為 urlencode 則填入 "%")
執行結果應為:
\xE6\xB7\xB5
若不經由 tr 轉換,則會得到小寫:
\xe6\xb7\xb5
上面兩者不分大小寫是等價的。
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information