NO

Author Topic: Troubles with Unicode  (Read 2705 times)

r1cs

  • Guest
Troubles with Unicode
« on: August 05, 2006, 11:42:54 AM »
Hello!
When I try to use Unicode with some language (for example, with Russian), I get an unreadable text. My code is:
Code: [Select]
#include <windows.h>

void start()
{
MessageBoxW(0, L"Hello, World!", NULL, MB_OK);
}

In the MessageBox window the text ("Hello, World!" - in Russian, of course) is totally unreadable. But if I type the text in English, it's all right. If I transfer my code (without any changes) into Visual C++ 6.0, it's all right too - both with Russian and English texts. I try the latest (4.50.90) version of the Pelles C for Windows, but the trouble with Unicode is still existing :(
Can I fix this trouble and how?

Regards,
r1cs

Offline Pelle

  • Administrator
  • Member
  • *****
  • Posts: 2266
    • http://www.smorgasbordet.com
Troubles with Unicode
« Reply #1 on: August 05, 2006, 12:58:56 PM »
I assume it's some kind of code page problem...

Does it help using the C compiler code_page() pragma:
#pragma code_page(number)

where number maybe is 1251 ?!
/Pelle

r1cs

  • Guest
Troubles with Unicode
« Reply #2 on: August 05, 2006, 03:26:18 PM »
Quote from: "Pelle"
Does it help using the C compiler code_page() pragma

It's working! Big thanks! =D>

P.S. I suppose, in the next time I should read the included help before to panic :?

Offline Pelle

  • Administrator
  • Member
  • *****
  • Posts: 2266
    • http://www.smorgasbordet.com
Troubles with Unicode
« Reply #3 on: August 06, 2006, 01:34:57 PM »
Quote from: "r1cs"
It's working! Big thanks! =D>

Good news - thanks...

Quote from: "r1cs"
P.S. I suppose, in the next time I should read the included help before to panic :?

It might stop me from panic... ;-)
/Pelle