📄 uni_convert.c
字号:
#include <string.h>
#include "api.h"
#include "lcd.h"
#include "common.h"
#include "display.h"
#include "res.h"
#include "res_show.h"
#include "prefer.h"
#include "uni_convert.h"
#include "get_latin2.h"
uni_latin temp[128];
INT16U OneUniToLatin(INT16U unicode) //1252
{
INT16U i;
INT32S tmp_offset;
if(unicode<=0x007f)
return unicode;
else
{
if(api_bSectionFileOpen(SYS_FONTBMP_FILEID) == FALSE)
return FALSE;
if(tUserPreference.u8LanguageId==0 || tUserPreference.u8LanguageId==13 || (tUserPreference.u8LanguageId>=5 && tUserPreference.u8LanguageId<=11))
{
tmp_offset = L1_UNIOFFSET;
}
else if(tUserPreference.u8LanguageId==12 || tUserPreference.u8LanguageId==14)
{
tmp_offset = L2_UNIOFFSET;
}
else if(tUserPreference.u8LanguageId==15)
{
tmp_offset = L3_UNIOFFSET;
}
else if(tUserPreference.u8LanguageId == 16)
{
tmp_offset = L4_UNIOFFSET;
}
else if(tUserPreference.u8LanguageId == 18)
{
tmp_offset = L5_UNIOFFSET;
}
api_bSectionFileSeek((INT32S)tmp_offset, SEEK_SET); //西欧语系
api_u16SectionFileRead(temp,sizeof(temp));
for(i=0;i<128;i++)
{
//api_u16SectionFileRead(&temp,sizeof(uni_latin));
if(unicode==temp[i].uni_code)
{
return temp[i].latin_code;
}
}
}
return unicode;
}
INT8U unitochar(char *str,int len)
{
INT16U s_cnt=0;
INT16U d_cnt=0;
INT16U _code;
for(d_cnt=0,s_cnt=0;(s_cnt<len)&&((str[s_cnt]!=0)||(str[s_cnt+1]!=0)); )
{
_code = OneUniToLatin(str[s_cnt]+str[s_cnt+1]*0x100);
str[d_cnt++]=_code;
s_cnt+=2;
}
str[d_cnt]=0;
return 1;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -