grid 显示中文乱码×××××××

god_sun 2010-01-08 09:18:57

void CFilelistContainer::AddDataL()
{

MDesCArray* array = iGrid->Model()->ItemTextArray();
CDesCArray* cArray = ( CDesCArray* )array;

// The number of items in the grid.
TInt numberOfData = 6;

// Delete data from array
if ( iGrid->GridModel()->NumberOfData() > 0 )
{
cArray->Delete( 0, iGrid->GridModel()->NumberOfData() );
}
iGrid->HandleItemRemovalL();

// Create text which is added to the grid
TBuf8<400> item;
_LIT(KItemFormat, "%d\t上海");
item.Append(KItemFormat);
for (int i = 0; i < numberOfData; i++)
{
item.Format(KItemFormat, 0, i);
cArray->AppendL(*aUnicode);
}
// Inform list box that data was added.
iGrid->HandleItemAdditionL();
}
...全文
372 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
striker 2010-01-11
  • 打赏
  • 举报
回复
可以考虑把中文字符串放到资源文件里,但是资源文件的编码需要改为UTF8.

在程序里面需要把TBuf8 改为 TBuf16
  • 打赏
  • 举报
回复
参考
http://blog.csdn.net/actual_/archive/2009/11/08/4787056.aspx
jmulxg 2010-01-08
  • 打赏
  • 举报
回复
gogole symbian 如何显示中文
alex_hua 2010-01-08
  • 打赏
  • 举报
回复
"_LIT(KItemFormat, "%d\t上海")"

这中文缺省是gbk编码,而grid显示需要unicode,需用自己转换一下~

3,119

社区成员

发帖
与我相关
我的任务
社区描述
塞班系统(Symbian系统)是塞班公司为手机而设计的操作系统,它的前身是英国宝意昂公司的 EP ( Electronic Piece of cheese)操作系统。
社区管理员
  • Symbian社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧