ChartDirector 6.0在MFC下乱码问题

xiaoxiao2021-02-28  21

 

1 2 3 4 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()函数实现如下:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 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); }

  

转载请注明原文地址: https://www.6miu.com/read-2050255.html

最新回复(0)