NO

Author Topic: can't support chinese string resource  (Read 4322 times)

pcce

  • Guest
can't support chinese string resource
« 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!

Offline Pelle

  • Administrator
  • Member
  • *****
  • Posts: 1974
    • http://www.smorgasbordet.com
Re: can't support chinese string resource
« Reply #1 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 ...
/Pelle

pcce

  • Guest
Re: can't support chinese string resource
« Reply #2 on: August 08, 2007, 01:30:08 pm »
please look:
I think you can find the problem and help me.




« Last Edit: August 08, 2007, 01:31:57 pm by pcce »

Offline Robert

  • Member
  • *
  • Posts: 187
Re: can't support chinese string resource
« Reply #3 on: August 08, 2007, 09:35:40 pm »
What operating system are you using?

Ngan Lo

  • Guest
Re: can't support chinese string resource
« Reply #4 on: August 10, 2007, 05:49:15 pm »
I think he is using Windows XP (Simplified Chinese ver)  :)

Offline Pelle

  • Administrator
  • Member
  • *****
  • Posts: 1974
    • http://www.smorgasbordet.com
Re: can't support chinese string resource
« Reply #5 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...
/Pelle

pcce

  • Guest
Re: can't support chinese string resource
« Reply #6 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!
« Last Edit: August 11, 2007, 08:23:52 am by pcce »

Offline Stefan Pendl

  • Global Moderator
  • Member
  • *****
  • Posts: 566
    • Homepage
Re: can't support chinese string resource
« Reply #7 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.
---
Stefan

Proud member of the UltraDefrag Development Team

Offline Pelle

  • Administrator
  • Member
  • *****
  • Posts: 1974
    • http://www.smorgasbordet.com
Re: can't support chinese string resource
« Reply #8 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...
/Pelle

severach

  • Guest
Re: can't support chinese string resource
« Reply #9 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.

larryli

  • Guest
Re: can't support chinese string resource
« Reply #10 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.