Pelles C forum

Pelles C => Feature requests => Topic started by: pcce on August 03, 2007, 01:47:30 pm

Title: can't support chinese string resource
Post by: pcce on August 03, 2007, 01:47:30 pm
This development kit is good!
But I can't use it, because the string(chinese) in the resource is turbid(random char)!
I hope it will support this perfect!
Thank you for your work for this project!
Title: Re: can't support chinese string resource
Post by: Pelle on August 03, 2007, 07:20:50 pm
I know nothing about Chinese, so it's hard to say what is missing to make it work. Perhaps adding support for UTF-8/16/32/whatever script files may help, but it's not something I really need or looking forward to add, so ...
Title: Re: can't support chinese string resource
Post by: pcce on August 08, 2007, 01:30:08 pm
please look:
I think you can find the problem and help me.
(http://dlyj.czm.cn/!tu/p1.jpg)
(http://dlyj.czm.cn/!tu/p2.jpg)
(http://dlyj.czm.cn/!tu/p3.jpg)
(http://dlyj.czm.cn/!tu/p4.jpg)
Title: Re: can't support chinese string resource
Post by: Robert on August 08, 2007, 09:35:40 pm
What operating system are you using?
Title: Re: can't support chinese string resource
Post by: Ngan Lo on August 10, 2007, 05:49:15 pm
I think he is using Windows XP (Simplified Chinese ver)  :)
Title: Re: can't support chinese string resource
Post by: Pelle on August 10, 2007, 11:55:44 pm
I will look at it. I don't have a Chinese version to test on, so don't hope too much...
Title: Re: can't support chinese string resource
Post by: pcce on August 11, 2007, 08:13:22 am
I think he is using Windows XP (Simplified Chinese ver)  :)
Yes, it's XP Simplified Chinese.

I will look at it. I don't have a Chinese version to test on, so don't hope too much...
Thank you very much!
Title: Re: can't support chinese string resource
Post by: Stefan Pendl on August 11, 2007, 04:25:24 pm
I will look at it. I don't have a Chinese version to test on, so don't hope too much...
There should be no need to use a Chinese installation, it should be enough to add a test user and set all his regional settings to Chinese.
I have done so before to duplicate a problem with another application.
Title: Re: can't support chinese string resource
Post by: Pelle on August 12, 2007, 09:07:31 pm
Quote from: Stefan Pendl
There should be no need to use a Chinese installation, it should be enough to add a test user and set all his regional settings to Chinese.
I have done so before to duplicate a problem with another application.
Thanks for the info - I will try that...
Title: Re: can't support chinese string resource
Post by: severach on August 22, 2007, 08:44:36 am
The problem I found for multiple non default language resource support was that PORC does not compile UTF-8 or UNICODE files with or without BOM which are the only practical ways to store characters from anything other than the localized language. I solved the problem by writing a program to translate PORC command line switches to Microsoft RC which allows RC to seamlessly integrate into POIDE.

Turns out that Microsoft RC is the only one that works. The rest are too limited, buggy, or hopelessly outdated. My tool translates the command lines for seamless IDE and makefile integration for all of the following resource compilers:

Pelles-C PORC
MinGW windres
Watcom WRC
Borland BRCC32
Digital Mars RCC

Now don't go editing those UNICODE files with the Pelles IDE. It only knows ASCII. Some fancy #include tricks keeps POIDE editing the files it should and avoiding the files it shouldn't.

I only added enough switches to make it compatible with all the IDE's and other spurious switches that I happened to notice. There might be a switch that a makefile uses that isn't supported but should be. As a programmer tool it doesn't have an install. It has a bat file that you may need to adapt to your system.
Title: Re: can't support chinese string resource
Post by: larryli on October 24, 2007, 06:56:48 am
I think PORC hasn't the bug (PORC can compile Chinese RC files correctly), and that's POIDE can NOT write Chinese RC files.
A Chinese character is 2 bytes likes other languages on UNICODE charset. On OEM charset (Chinese GB2312) the Chinese character is ALSO 2 bytes, but an English character is ONLY 1 byte.
So, when you use WideCharToMultiByte() to tranlate string you can get Unicode string length is half of byte size. This length is same as length on ASNI charset, but less-than Chinese charset. On Chinese OEM charset, a chinese character is 2 bytes, and the length is double of the characters.
I think Pelle must increase buffer to put enough Chinese characters.