之前做一些功能,平时时没注意细节,有时显示成乱码,现简单整理了一下字符显示问题,以后可以查询!
1.双字节复制到双字节
MMI_WSTRNCPY( wchar* dst,size_t dst_max_count, const wchar* src,size_t src_max_count, size_t count )
const wchar strtmp[]={'3','4','8','8','x','2','6','1','6',0};
const wchar kur_wstr[] ={'2','0','4','8','x','1','5','3','6',0};
if(MMIAPICOM_Wstrncmp(size_str_ptr,kur_wstr,MMIAPICOM_Wstrlen(kur_wstr)) == 0)
MMIAPICOM_Wstrcpy(size_str_ptr->str,strtmp);
2.双字节复制到单字节
MMI_WSTRNTOSTR( uint8* dst, size_t dst_max_count,const wchar* src, size_t src_max_count,size_t count)
const wchar strtmp[]={'3','4','8','8','x','2','6','1','6',0};
char kur_wstr[20];
MMI_WSTRNTOSTR(kur_wstr,20,strtmp,20,MMIAPICOM_Wstrlen(strtmp));
3.单字节复制到双字节
MMI_STRNTOWSTR( wchar* dst,size_t dst_max_count, const uint8* src, size_t src_max_count, size_t count)
const char strtmp[]={'3','4','8','8','x','2','6','1','6',0};
wchar kur_wstr[20];
MMI_STRNTOWSTR(kur_wstr,20,strtmp,20,strlen(strtmp));
4.单字节复制到单字节
无