啟源
    有一次知道新倉頡,也能輸入特輸字元,只是要用內碼方法輸入(按 ` ),可我那知道內碼是多少,就想說來寫個工具來用用。

開發環境:Window 2003
開發工具:Visual Stutio 2005
開發語言:C++\CLI
開發時間:95年11月(96年8月有作小修改)

Source Download

[個人作品]CharSetConvert 字元集轉換

說明
主要就三種字元集,三種輸出方法的轉換

重要代碼
Convert.h

轉成內碼
        }
Convert.h

使用Encoding的GetBytes取得的Bytes

Big5中ASCII 為一個 Byte,中文字為二個Byte,第一個Byte*256 + 第二個Byte 才會等於內碼格式
Unicode都是二個Byte,第一個Byte + 第二個Byte*256  才會等於內碼格式
UTF8不清楚內碼直接以格式輸出       

轉成文字
[個人作品]CharSetConvert 字元集轉換static System::String^ ToWord(Encoding^ encode,int fromBase,System::String^  text)

Convert.h

使用Encoding的GetStrings取得的文字

Big5中ASCII 為一個 Byte,中文字為二個Byte,第一個Byte為Value / 256 + 第二個Byte為Value % 256
Unicode都是二個Byte,第一個Byte為Value % 256 + 第二個Byte為Value / 256
UTF8 Value轉成Bytes

參考資料
Wiki UTF-8   http://zh.wikipedia.org/wiki/UTF-8
Binary, Hexadecimal, UTF-8 Converter http://www.stanford.edu/~hc10/misc/binhexuni.html

 

相关文章:

  • 2022-12-23
  • 2022-02-16
  • 2021-12-12
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-07
  • 2021-12-05
猜你喜欢
  • 2022-12-23
  • 2022-01-04
  • 2022-12-23
  • 2022-02-11
  • 2021-11-21
  • 2021-06-30
相关资源
相似解决方案