Hi Mike,
ChartDirector assumes all text to be UTF8 encoded. In MFC, I think the _T string can be Unicode (2 bytes per character) or a kind of ANSI encoding, depending on how your MFC project is configured. (An ANSI encoding only works for one language. In contrast, UTF8 works for all languages at the same time.)
If you are using _T string, there is a TCHARtoUTF8 utility in ChartDirector that can convert _T string to UTF8 string:
layer->addDataSet(viewPortDataSeriesA, 0xff0000, TCHARtoUTF8(_T("Non-English-Charset")));//"Alpha");
Also, if you need to display the character (eg. as the text in the legend box), please use a font that can support your language. For example, for traditional chinese, I often use:
c->addLegend(x, y, true, "mingliu.ttc", 10);
or
c->setDefaultFonts("mingliu.ttc", "mingliu.ttc bold");
Hope this can help.
Regards
Peter Kwan |