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

Message ListMessage List     Post MessagePost Message

  Encoding Error...
Posted by mfctest on Jul-24-2015 17:16
Attachments:
I'm using CharDirector 5.1.1 version. (C++ / MFC)
I need to enter Korean into title and legend.
However, but the same code, the other results were revealed.
(title -> OK, legend -> NG)

//--------------------------------------------------------------------------
wchar_t strUni[256] =L"유니코드";
char title[256] = {0x00,};
WideCharToMultiByte(CP_UTF8, 0, strUni, -1, title, sizeof(char)*MAX_BUFFER_SIZE, 0, 0);

c->addTitle(title);

LineLayer *layer = c->addLineLayer();
layer->setXData(DoubleArray(x, 10));
layer->addDataSet(DoubleArray(y, 10), 0xff0000, title);
//--------------------------------------------------------------------------
__.PNG

  Re: Encoding Error...
Posted by Peter Kwan on Jul-25-2015 03:45
Attachments:
Hi,

I have just tried myself, and it works normally in my case. Below please find my test code
and also the resulting chart image.

wchar_t strUni[256] =L"유니코드";
char title[256] = {0x00,};
WideCharToMultiByte(CP_UTF8, 0, strUni, -1, title, sizeof(char)*255, 0, 0);

double x[] = { 0, 1, 2 };
double y[] = { 50, 100, 150 };

XYChart *c = new XYChart(250, 250);
c->setDefaultFonts("gulim.ttc", "gulim.ttc");
c->setPlotArea(30, 60, 200, 160);

c->addTitle(title);

LineLayer *layer = c->addLineLayer();
layer->setXData(DoubleArray(x, 3));
layer->addDataSet(DoubleArray(y, 3), 0xff0000, title);
c->addLegend(30, 22);

// Output the chart
m_ChartViewer.setChart(c);

I am testing using the "Hello World" mfcdemo project and replace the original code with
my test code. I have attached the entire project for your reference.

Note that in the code, I used the "gulim.ttc" font, which is a font in my system that can
display Korean.

If the above still does not solve the problem, is it possible to create a sample project
(perhaps by modifying the attached project) to help me reproducing the problem?

Regards
Peter Kwan
helloworld.png
korean_helloworld.zip
korean_helloworld.zip

20.18 Kb

  Re: Encoding Error...
Posted by MFCTest on Jul-28-2015 09:21
Thank you very much. It was successfully resolved thanks.!!!!