Abiword中字符操作
Abiword中字符操作
一、關于不同字符的宏定義
typedef gunichar??????? UT_UCS4Char;
typedef guint16????? UT_UCS2Char;
typedef UT_UCS4Char??UT_UCSChar;?/* Unicode */
?
typedef guint32 gunichar;
typedef guint16 gunichar2;
?
AbiWord is now fully converted to using 32-bit Unicode internally
在Abiword內部完全轉換成32-bit Unicode 表示。
二、針對UT_UCS*Char 的常用函數,參考:af\util\xp\ut_string.cpp
UT_UCS4_strcmp 比較兩個字符串
UT_UCS4_strlen?? 取字符串的長度
UT_UCS4_strcpy? 復制字符串
UT_UCS4_strcpy_char?????? 從char到UT_UCS4Char的復制
UT_UCS4_strcpy_to_char? 從UT_UCS4Char到char的復制
對UT_UCS2Char有對應的操作
三、編碼轉換
AP_Win32App::s_fromWinLocaleToUTF8,將本地編碼轉換成UTF-8
AP_Win32App::s_fromUTF8ToWinLocale,將UTF-8轉換成本地編碼
AP_Win32App::s_fromUCS4ToWinLocale
AP_Win32App::s_fromWinLocaleToUCS4
四、Abiword對字符類型的封裝
1、UT_String,UT_String, a simple wrapper for zero terminated 'char' strings.對char類型的封裝。
//? 8-bit string
//? String is built of 8-bit units (bytes)
//? Encoding could be any single-byte or multi-byte encoding
2、UT_UTF8String,UT_UTF8String, a simple wrapper for zero terminated 'UTF-8' strings.UTF-8編碼的字符封裝
//? UTF-8 string: encoding is *always* UTF-8
3、UT_UCS4String,UT_UCS4String, a simple wrapper for zero terminated 'UCS4' strings.USC4字符的封裝
?
?
//? UCS-4 string
//? String is built of 32-bit units (longs)
//? NOTE: Ambiguity between UCS-2 and UTF-16 above makes no difference
//? NOTE:? in the case of UCS-4 and UTF-32 since they really are
//? NOTE:? identical
?
?四、MSDN?Generic-Text Mappings
?????? MSDN中"Generic-Text Routine Mappings."標題下有完整的宏列表。
轉載于:https://www.cnblogs.com/songtzu/p/3539777.html
總結
以上是生活随笔為你收集整理的Abiword中字符操作的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 2017年初随想——几个小目标
- 下一篇: Altium Designer 21/A