Exemple #1
0
void module_init_encode_arabic(ptu32_t para)
{
    static struct Charset encoding;

    int i=0;
   //加载字库
     printf("Init the code\n");
    arabic_file_code=GetLanguagecodeFromFile(ArialFile);
    if(arabic_file_code==NULL)
    {
         printf("Get file code failed!\n");
         return;
    }
    nSections=((struct FontLibHeader*)arabic_file_code)->nSection;
    pSectionInfo=(struct FlSectionInfo *)(arabic_file_code+0x10);

    //打印编码信息
    for(i=0;i<nSections;i++)
        {
     printf("Section=%d ,First=%04x,Last=%04x,Addr=%08x\n",i,pSectionInfo[i].First,\
        pSectionInfo[i].Last,pSectionInfo[i].OffAddr);

    }

    encoding.max_len = 2;
    encoding.EOC_Size = 1;
    encoding.GetOneMb = ArabicGetOneMb;
    encoding.MbToUcs4 = ArabicMbToUcs4;
    encoding.Ucs4ToMb = ArabicUcs4ToMb;
    encoding.MbsToUcs4s = ArabicMbsToUcs4s;
    encoding.Ucs4sToMbs = ArabicUcs4sToMbs;
    if( Charset_NlsInstallCharset(&encoding, CN_NLS_CHARSET_ARABIC))
    {
        printf("arabic encoding install sucess\n\r");
        return 1;
    }else
    {
        Djy_SaveLastError(EN_GK_CHARSET_INSTALL_ERROR);
        printf("arabic encoding install fail\n\r");
        return 0;
    }


}
Exemple #2
0
void module_init_encode_arabic(ptu32_t para)
{
    static struct tagCharset encoding;

    int i=0;
   //加载字库
     printf("Init the code\n");
    arabic_file_code=GetLanguagecodeFromFile(ArialFile);
    if(arabic_file_code==NULL)
        {
         printf("Get file code failed!\n");
         return;
    }
    nSections=((struct tagFontLibHeader*)arabic_file_code)->nSection;
    pSectionInfo=(struct tagFlSectionInfo *)(arabic_file_code+0x10);

    //打印编码信息
    for(i=0;i<nSections;i++)
        {
     printf("Section=%d ,First=%04x,Last=%04x,Addr=%08x\n",i,pSectionInfo[i].First,\
        pSectionInfo[i].Last,pSectionInfo[i].OffAddr);

    }

    encoding.max_len = 1;
    encoding.mb_to_ucs4 = __arabic_mb_to_ucs4;
    encoding.ucs4_to_mb = __arabic_ucs4_to_mb;
    encoding.mbs_to_ucs4s = __arabic_mbs_to_ucs4s;
    encoding.ucs4s_to_mbs = __arabic_ucs4s_to_mbs;
    if( Charset_NlsInstallCharset(&encoding, cn_nls_charset_arabic))
    {
        printf("arabic encoding install sucess\n\r");
        return 1;
    }else
    {
        Djy_SaveLastError(EN_GK_CHARSET_INSTALL_ERROR);
        printf("arabic encoding install fail\n\r");
        return 0;
    }


}
Exemple #3
0
//----安装ascii字符集----------------------------------------------------------
//功能: 安装ascii字符集,当系统使用西方字符界面时,使用这个字符集。特别注意,
//      gb2312已经包含了英文字符集,使用中文或中英文混合界面的,不需要安装ascii
//      字符集。但是,由于GB2312的字库只包含了全角的英文字符,故还需要安装ascii
//      的字体资源,尺寸(8*8、8*16)可选。
//参数: 无意义
//返回: 1=成功,0=失败
//-----------------------------------------------------------------------------
ptu32_t ModuleInstall_CharsetAscii(ptu32_t para)
{
    static struct tagCharset encoding;

    encoding.max_len = 1;
    encoding.mb_to_ucs4 = Charset_AsciiModuleInitMbToUcs4;
    encoding.ucs4_to_mb = Charset_AsciiModuleInitUcs4ToMb;
    encoding.mbs_to_ucs4s = Charset_AsciiModuleInitMbsToUcs4s;
    encoding.ucs4s_to_mbs = Charset_AsciiModuleInitUcs4sToMbs;
    if( Charset_NlsInstallCharset(&encoding, CN_NLS_CHARSET_ASCII))
    {
        printf("ASCII encoding install sucess\r\n");
        return 1;
    }else
    {
        Djy_SaveLastError(EN_GK_CHARSET_INSTALL_ERROR);
        printf("ASCII encoding install fail\n\r");
        return 0;
    }
}
Exemple #4
0
//----安装utf8字符编码解析器---------------------------------------------------
//功能: 安装utf8字符编码解析器,执行ucs4和编码和utf8编码之间转换。
//参数: 无意义
//返回:1=成功,0=失败
//-----------------------------------------------------------------------------
ptu32_t ModuleInstall_CharsetUtf8(ptu32_t para)
{
    static struct Charset encoding;

    encoding.max_len = 6;
    encoding.EOC_Size = 1;
    encoding.GetOneMb = Utf8GetOneMb;
    encoding.MbToUcs4 = Utf8MbToUcs4;
    encoding.Ucs4ToMb = Utf8Ucs4ToMb;
    encoding.MbsToUcs4s = Utf8MbsToUcs4s;
    encoding.Ucs4sToMbs = Utf8Ucs4sToMbs;
    if( Charset_NlsInstallCharset(&encoding, CN_NLS_CHARSET_UTF8))
    {
        printf("utf8 encoding install sucess\n\r");
        return 1;
    }else
    {
        Djy_SaveLastError(EN_GK_CHARSET_INSTALL_ERROR);
        printf("utf8 encoding install fail\n\r");
        return 0;
    }
}