微波EDA网,见证研发工程师的成长!
首页 > 研发问答 > 手机设计讨论 > MTK手机平台交流 > mt2503 打开宏 CFG_MMI_CHSET_CYRILLIC_WIN,将编码方式设为 W1251,字...

mt2503 打开宏 CFG_MMI_CHSET_CYRILLIC_WIN,将编码方式设为 W1251,字...

时间:10-02 整理:3721RD 点击:
[CharSet] 打开宏CFG_MMI_CHSET_CYRILLIC_WIN,将编码方式设为W1251,字符显示或者编码转换不正确

[DESCRIPTION]
打开宏CFG_MMI_CHSET_CYRILLIC_WIN,将编码方式设为W1251,字符显示或者编码转换不正确.

[SOLUTION]
历史原因这部分code的没完善,W1251转换时使用的并不是对应的表,需要做以下修改:
1、'Conversions.c'中mmi_chset_init()需要修改:
目前:
#ifdef__MMI_CHSET_CYRILLIC_WIN__
g_chset_tbl[CYRILLIC_WINDOWS_TO_UCS2].pConversnTable=&g_chset_cyrillic_ucs2_win[0];
g_chset_tbl[CYRILLIC_WINDOWS_TO_UCS2].pMappingTable=&g_chset_map_ucs2_common[0];
g_chset_tbl[CYRILLIC_WINDOWS_TO_UCS2].TotalMapTbIndex=mmi_chset_map_ucs2_common_size();
g_chset_tbl[CYRILLIC_WINDOWS_TO_UCS2].Input_word_bits=CHSET_BIT_WORD_8;
g_chset_tbl[CYRILLIC_WINDOWS_TO_UCS2].Output_word_bits=CHSET_BIT_WORD_16;
g_chset_tbl[CYRILLIC_WINDOWS_TO_UCS2].UndefChar=0x003F;
g_chset_tbl[UCS2_TO_CYRILLIC_WINDOWS].pConversnTable=(constkal_uint16*)&g_chset_ucs2_cyrillic_win[0];
g_chset_tbl[UCS2_TO_CYRILLIC_WINDOWS].pMappingTable=&g_chset_map_ucs2_cyrillic_win[0];
g_chset_tbl[UCS2_TO_CYRILLIC_WINDOWS].TotalMapTbIndex=mmi_chset_map_cyrillic_ucs2_win_size();
g_chset_tbl[UCS2_TO_CYRILLIC_WINDOWS].Input_word_bits=CHSET_BIT_WORD_16;
g_chset_tbl[UCS2_TO_CYRILLIC_WINDOWS].Output_word_bits=CHSET_BIT_WORD_8;
g_chset_tbl[UCS2_TO_CYRILLIC_WINDOWS].UndefChar=0x3F;
#endif/*__MMI_CHSET_CYRILLIC_WIN__*/
应该改为:
#ifdef__MMI_CHSET_CYRILLIC_WIN__
g_chset_tbl[CYRILLIC_WINDOWS_TO_UCS2].pConversnTable=&g_chset_cyrillic_ucs2_win[0];
g_chset_tbl[CYRILLIC_WINDOWS_TO_UCS2].pMappingTable=&g_chset_map_cyrillic_ucs2_win[0];
g_chset_tbl[CYRILLIC_WINDOWS_TO_UCS2].TotalMapTbIndex=mmi_chset_map_cyrillic_ucs2_win_size();
g_chset_tbl[CYRILLIC_WINDOWS_TO_UCS2].Input_word_bits=CHSET_BIT_WORD_8;
g_chset_tbl[CYRILLIC_WINDOWS_TO_UCS2].Output_word_bits=CHSET_BIT_WORD_16;
g_chset_tbl[CYRILLIC_WINDOWS_TO_UCS2].UndefChar=0x003F;
g_chset_tbl[UCS2_TO_CYRILLIC_WINDOWS].pConversnTable=(constkal_uint16*)&g_chset_ucs2_cyrillic_win[0];
g_chset_tbl[UCS2_TO_CYRILLIC_WINDOWS].pMappingTable=&g_chset_map_ucs2_cyrillic_win[0];
g_chset_tbl[UCS2_TO_CYRILLIC_WINDOWS].TotalMapTbIndex=mmi_chset_map_ucs2_cyrillic_win_size();
g_chset_tbl[UCS2_TO_CYRILLIC_WINDOWS].Input_word_bits=CHSET_BIT_WORD_16;
g_chset_tbl[UCS2_TO_CYRILLIC_WINDOWS].Output_word_bits=CHSET_BIT_WORD_8;
g_chset_tbl[UCS2_TO_CYRILLIC_WINDOWS].UndefChar=0x3F;
#endif/*__MMI_CHSET_CYRILLIC_WIN__*/
同步在charsettable.h里添加外部引用的定义
#ifdef__MMI_CHSET_CYRILLIC_WIN__
externconstkal_uint8g_chset_ucs2_cyrillic_win[];
externconstunsignedshortg_chset_cyrillic_ucs2_win[];
externconstMapping_Structg_chset_map_ucs2_cyrillic_win[];
externconstMapping_Structg_chset_map_cyrillic_ucs2_win[];
externunsignedshortmmi_chset_map_cyrillic_ucs2_win_size(void);
externunsignedshortmmi_chset_map_ucs2_cyrillic_win_size(void);
#endif/*__MMI_CHSET_CYRILLIC_WIN__*/

2.在'Conversions.c'中修改数组的g_chset_state[]的定义(如果已经正确就不需要再修改)。
把g_chset_state[]


#ifdef__MMI_CHSET_CEURO_WIN__
1,
#else
0,
#endif
#ifdef__MMI_CHSET_GREEK_ISO__
1,
#else
0,
#endif
#ifdef__MMI_CHSET_CYRILLIC_ISO__
1,
#else
0,
#endif
#ifdef__MMI_CHSET_CYRILLIC_WIN__
1,
#else
0,
#endif
#ifdef__MMI_CHSET_GREEK_WIN__
1,
#else
0,
#endif


修改为[把宏__MMI_CHSET_GREEK_ISO__定义的位置移到宏__MMI_CHSET_CYRILLIC_WIN__定义的后面]
g_chset_state[]


#ifdef__MMI_CHSET_CEURO_WIN__
1,
#else
0,
#endif
#ifdef__MMI_CHSET_CYRILLIC_ISO__
1,
#else
0,
#endif
#ifdef__MMI_CHSET_CYRILLIC_WIN__
1,
#else
0,
#endif
#ifdef__MMI_CHSET_GREEK_ISO__
1,
#else
0,
#endif
#ifdef__MMI_CHSET_GREEK_WIN__
1,
#else
0,
#endif


Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top