码迷,mamicode.com
首页 > 编程语言 > 详细

ChartDirector 6.0在MFC下乱码问题

时间:2016-07-13 22:07:38      阅读:160      评论:0      收藏:0      [点我收藏+]

标签:

 

 

XYChart *c = new XYChart(640, 350);
char buffer1[256] = "";
UnicodeToUtf8(L"Realtime Chart with Zoom/Scroll and Track Line测试", buffer1);
c->addTitle(buffer1, "simsun.ttc", 18);

 

UnicodeToUtf8()函数实现如下:

void UnicodeToUtf8(const TCHAR *unicode, char *utf8)
{
  int len = WideCharToMultiByte(CP_UTF8, 0, (const TCHAR *)unicode, -1, NULL, 0, NULL, NULL);

  memset(utf8, 0, len * 2 + 2);
  WideCharToMultiByte(CP_UTF8, 0, (const TCHAR *)unicode, -1, utf8, len, NULL, NULL);
}

void Utf8ToUnicode(const char *utf8, TCHAR *unicode)
{
  int len = MultiByteToWideChar(CP_UTF8, 0, (const char *)utf8, -1, NULL, 0);

  MultiByteToWideChar(CP_UTF8, NULL, utf8, -1, unicode, len);
}

  

ChartDirector 6.0在MFC下乱码问题

标签:

原文地址:http://www.cnblogs.com/wjx0912/p/5667566.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!