UNICODE 问题!!! UP 有分!!
CMapLayer::CMapLayer(CDemo2Doc* pDoc, CArchive& ar)
{
CString str, str1;
int i, j, k;
CMapObject* object;
m_pDoc = pDoc;
m_nMaxPoint = 0;
m_bCanDraw = true;
while ( ar.ReadString(str) )//一行一行的读,田加的
{
str1=GetFirstPara(str);
if(str1=="Region")
{//区域图元
j=GetSecondPara(str);//读多边形个数
for(i=0;i<j;i++)
{//创建多边形对象
ar.ReadString(str);
k = atoi(LPCTSTR(str));//读当前多边形端点数
object = new CMapRegion(pDoc, ar, k);
m_aObject.Add(object);
m_nMaxPoint = m_nMaxPoint > object->m_nMaxPoint ? m_nMaxPoint : object->m_nMaxPoint;
}
}
else if(str1=="Pline")
{//线图元
j=GetSecondPara(str);//读折线端点数
object = new CMapPLine(pDoc, ar, j);
m_aObject.Add(object);
m_nMaxPoint = m_nMaxPoint > object->m_nMaxPoint ? m_nMaxPoint : object->m_nMaxPoint;
}
else if(str1=="Text")
{
object = new CMapText(pDoc, ar);
m_aObject.Add(object);
m_nMaxPoint = m_nMaxPoint > object->m_nMaxPoint ? m_nMaxPoint : object->m_nMaxPoint;
}
}
}
本想通过行读while ( ar.ReadString(str) ) 来取到文本文件中的每一行,然后判断关键字if(str1=="Region"),if(str1=="Pline"),if(str1=="Text") 来进行绘图,但现在取出的STR是乱码,后来才发现,STR内读取文本是按双字节进行的,每次读两个字符,因此产生了类似方块字的乱码,有什么解决方案吗?该程序由VC版本移植.VC下正确.
{
CString str, str1;
int i, j, k;
CMapObject* object;
m_pDoc = pDoc;
m_nMaxPoint = 0;
m_bCanDraw = true;
while ( ar.ReadString(str) )//一行一行的读,田加的
{
str1=GetFirstPara(str);
if(str1=="Region")
{//区域图元
j=GetSecondPara(str);//读多边形个数
for(i=0;i<j;i++)
{//创建多边形对象
ar.ReadString(str);
k = atoi(LPCTSTR(str));//读当前多边形端点数
object = new CMapRegion(pDoc, ar, k);
m_aObject.Add(object);
m_nMaxPoint = m_nMaxPoint > object->m_nMaxPoint ? m_nMaxPoint : object->m_nMaxPoint;
}
}
else if(str1=="Pline")
{//线图元
j=GetSecondPara(str);//读折线端点数
object = new CMapPLine(pDoc, ar, j);
m_aObject.Add(object);
m_nMaxPoint = m_nMaxPoint > object->m_nMaxPoint ? m_nMaxPoint : object->m_nMaxPoint;
}
else if(str1=="Text")
{
object = new CMapText(pDoc, ar);
m_aObject.Add(object);
m_nMaxPoint = m_nMaxPoint > object->m_nMaxPoint ? m_nMaxPoint : object->m_nMaxPoint;
}
}
}
本想通过行读while ( ar.ReadString(str) ) 来取到文本文件中的每一行,然后判断关键字if(str1=="Region"),if(str1=="Pline"),if(str1=="Text") 来进行绘图,但现在取出的STR是乱码,后来才发现,STR内读取文本是按双字节进行的,每次读两个字符,因此产生了类似方块字的乱码,有什么解决方案吗?该程序由VC版本移植.VC下正确.
...全文
相关推荐
Python库 | tangled_up_in_unicode-0.0.2.tar.gz
python库。 资源全名:tangled_up_in_unicode-0.0.2.tar.gz
XE5 AES Ansi Unicode UTF8
XE5 AES加密支持Ansi Unicode UTF8加密解密(支持多位,CSDN上XE2 AES加密解密只支持16位,好东西要分享)。
Unicode全球分区
Unicode字符集的详细细分,非常实用,现在免费下载使用了!!!
python-unicode:快速,轻松地将Unicode添加到Python代码的方法
python-unicode 快速,轻松地将Unicode添加到Python代码的方法 :face_with_tears_of_joy: :zany_face: :shushing_face: :grinning_face_with_sweat: :smiling_face_with_heart-eyes: :thumbs_up:
XE5 And Upper AES Ansi Unicode UTF8
XE5 And Upper AES Ansi Unicode UTF8 手机平台 AES 加密解密


