XE5里如何使用TENCODING正确进行编码转换
1个回答
展开全部
var<br data-filtered="filtered">
astr:String;<br data-filtered="filtered">
begin<br data-filtered="filtered">
astr:= memo1.Text;<br data-filtered="filtered">
astr:=Tencoding.Default.getstring(Tencoding.GetEncoding(CP_UTF8).GetBytes(astr));//gbk转UTF8<br data-filtered="filtered">
memo2.Text:=astr;<br data-filtered="filtered">
memo2.Lines.Append(httpencode(astr));<br data-filtered="filtered">
<br data-filtered="filtered">
astr:=Tencoding.GetEncoding(CP_UTF8).GetString(Tencoding.Default.GetBytes(astr));//UTF8转gbk<br data-filtered="filtered">
memo3.Text:=astr;<br data-filtered="filtered">
memo3.Lines.Append(httpencode(astr));
astr:String;<br data-filtered="filtered">
begin<br data-filtered="filtered">
astr:= memo1.Text;<br data-filtered="filtered">
astr:=Tencoding.Default.getstring(Tencoding.GetEncoding(CP_UTF8).GetBytes(astr));//gbk转UTF8<br data-filtered="filtered">
memo2.Text:=astr;<br data-filtered="filtered">
memo2.Lines.Append(httpencode(astr));<br data-filtered="filtered">
<br data-filtered="filtered">
astr:=Tencoding.GetEncoding(CP_UTF8).GetString(Tencoding.Default.GetBytes(astr));//UTF8转gbk<br data-filtered="filtered">
memo3.Text:=astr;<br data-filtered="filtered">
memo3.Lines.Append(httpencode(astr));
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询