使用 Node 安裝 Whistle

1
npm i -g whistle
Read more »

轉換 Big5 字元

Big5 依傳入內碼轉成字元

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// 建立兩位元陣列
byte[] big5Bytes = new byte[2];

// big5 數字 0 內碼為 A2AF
string big5Code = "A2AF";

// 內碼前兩字轉為16進制
big5Bytes[0] = (byte)Convert.ToInt32(big5Code.Substring(0, 2), 16);

// 內碼後兩字轉為16進制
big5Bytes[1] = (byte)Convert.ToInt32(big5Code.Substring(2, 2), 16);

// 建立 big5 編碼
Encoding big5 = Encoding.GetEncoding(950);

// 轉成字串
string result = big5.GetString(big5Bytes);
Read more »
0%