Unicode Question [Archive] - Quintessential Forum

PDA

View Full Version : Unicode Question


acozz
01-17-2004, 04:41 PM
I'm using the 4.11 PDK with B69.

The Plugin Version is set to PLUGIN_API_WANTUTF8.

I'm doing this:
WCHAR artist[MAX_PATH] = {0x0000};
int succ = qcdInfo->serviceFunc(opGetArtistName, artist, MAX_PATH, -1);

succ is set to 1 so it worked. And when I look at the string it is the correct length.

But then when I do this:
char s[MAX_PATH] = {0};
qcdInfo->serviceFunc(opUCS2toUTF8, artist, (long)s, MAX_PATH);

s is filled with gibberish characters. For a 4 character artist name, I get a artist buffer filled with 2 WCHARs (seems right I think) and the s buffer is filled with 6 gibberish characters.

What am I doing wrong?

acozz
01-17-2004, 04:59 PM
Nevermind, UTF8 does not equal Unicode. My bad, mind lapsed there for a bit.

acozz
01-17-2004, 05:03 PM
By the way, did you ever make the change that if you pass NULL to an op like opGetArtistName it would return the size somehow?

I suggested it in the old forum and you said you would. But I didn't notice anything in the changelog since then.