zoukankan      html  css  js  c++  java
  • 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 的常用函数,参考:afutilxput_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."标题下有完整的宏列表。

  • 相关阅读:
    HDU2515_数学规律题
    HDU1086_You can Solve a Geometry Problem too_判断两线段相交
    HDU1115_Lifting the Stone_凹凸多边形重心_可作为模板
    HDU2036_改革春风照大地_点求多边形面积
    Codeforces Beta Round #92 (Div. 2 Only) _A题
    HDU2108_Shape of HDU_判断凹凸
    response.setContentType设置
    vue 文件下载实现
    iText5实现Java生成PDF文件完整版
    java使用IText将数据导出为pdf文件(数据为excel表格样式)
  • 原文地址:https://www.cnblogs.com/songtzu/p/3539777.html
Copyright © 2011-2022 走看看