ASE Home Page Products Download Purchase Support About ASE
ChartDirector Support
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  ChartDirector setMonthNames suport chinese the months are Garbled
Posted by guhuisec on Jan-23-2013 16:37
Attachments:
hello! i have one question:when i setMonthNames use chinese. the  months are Garbled.
the codes:

const char *szMonthsLabs[]={_UT("一月"),_TU("二月"),"三月","四月","五月","六月","七月",
"八月","九月","十月","十一月","十二月"};

c->setMonthNames(StringArray(szMonthsLabs,(int)(sizeof(szMonthsLabs)/sizeof(szMonthsLabs[0]))));


before those i set:
c->setDefaultFonts(_TU("SIMSUN.TTC"),_TU("SIMSUN.TTC"),_TU("SIMSUN.TTC"),_TU("SIMSUN.TTC"));


please!

thanks
1111.jpg

  Re: ChartDirector setMonthNames suport chinese the months are Garbled
Posted by Peter Kwan on Jan-23-2013 17:24
Hi guhuisec,

For Chinese characters and other non-ASCII characters, please make sure it is using UTF8 encoding. To do this, please configure your compiler and/or editor to use UTF8 for literal text strings.

If you cannot control the compiler, and you are using Visual Studio in an MFC application, you may consider to use the ChartDirector function TCHARtoUTF8 to convert the MFC TCHAR to UTF8 at runtime. Please refer to the following thread for an example:

http://www.chartdir.com/forum/download_thread.php?bn=chartdir_support&thread=1284738874#N1284745433

Hope this can help.

Regards
Peter Kwan