FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Unicode Support to Dialogs from Resources
Posts: 654
Joined: Fri Oct 21, 2005 05:54 AM
Unicode Support to Dialogs from Resources
Posted: Tue Sep 29, 2015 08:39 AM
Dear Mr.Antonio,

I was testing Unicode support from our FiveWin. All seems to be working ok
to the extent of Unicode implemented sofar upto FWH_1509.

But one thing i noticed is that the text from Dialogs in R.C are not being
converted.

viewtopic.php?f=3&t=31392


free image host

My I request you to look into this when you find time.

Regards,

-Ramesh Babu P
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Unicode Support to Dialogs from Resources
Posted: Tue Sep 29, 2015 02:16 PM

Dear Ramesh,

Could you please test it again doing oDlg:lTransparent := .T. before the ACTIVATE DIALOG ?

Please post the resulting screenshot here.

Many thanks

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Unicode Support to Dialogs from Resources
Posted: Tue Sep 29, 2015 04:44 PM

Ramesh,

Are those dialogs from a RC file ?

If so, could you please post here the RC file or send it to my email ?

thanks

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 866
Joined: Tue Oct 16, 2007 08:57 AM
Re: Unicode Support to Dialogs from Resources
Posted: Wed Sep 30, 2015 05:21 AM
Antonio Linares wrote:Ramesh,

Are those dialogs from a RC file ?

If so, could you please post here the RC file or send it to my email ?

thanks


Antonio,

I make this sample, PRG and RC that I convert to UTF-8 style.

http://www.fivetech.com.tw/downloads/TestChinese-u8-V3.rar

Code (fw): Select all Collapse
// Add this to your resources RC file

#ifdef __FLAT__
   1 24 "./WinXP/WindowsXP.Manifest"
#endif

new      BITMAP "./bitmaps/32x32/new.bmp"
quit     BITMAP "./bitmaps/32x32/quit.bmp"

TEST DIALOG 20, 41, 356, 86
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "測試  Unicode 繁體中文(Traditional Chinese)-例如堃,叙"
FONT 12, "細明體"
{
 EDITTEXT 201, 68, 7, 170, 12
 EDITTEXT 202, 68, 22, 99, 12
 CONTROL "存檔", 301, "BUTTON", BS_USERBUTTON | WS_TABSTOP, 302, 8, 46, 18
 CONTROL "取消", 302, "BUTTON", BS_USERBUTTON | WS_TABSTOP, 302, 29, 46, 18
 CONTROL "列印", 303, "BUTTON", BS_USERBUTTON | WS_TABSTOP, 302, 50, 46, 18
 LTEXT "中文地址", 101, 5, 7, 60, 12
 LTEXT "中文姓名", 102, 5, 22, 60, 12
}
Best Regards,



Richard



Harbour 3.2.0dev (r2503251254) => Borland C++ v7.7 32bit

MySQL v8.0

Harbour 3.2.0dev (r2503251254) => Borland C++ v7.7 64bit
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Unicode Support to Dialogs from Resources
Posted: Wed Sep 30, 2015 08:34 AM
It seems as we have to use cgrc.exe for resources with unicode:

http://blog.spreendigital.de/2008/10/14/unicode-in-resource-files/
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: Unicode Support to Dialogs from Resources
Posted: Wed Sep 30, 2015 11:00 AM
Look

Cristobal Navarro

Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo

El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Unicode Support to Dialogs from Resources
Posted: Wed Sep 30, 2015 11:11 AM

Dear Cristobal,

Please explain the changes in buildh.bat, many thanks! :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: Unicode Support to Dialogs from Resources
Posted: Wed Sep 30, 2015 11:13 AM

Antonio

I've sent an email

Cristobal Navarro

Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo

El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Unicode Support to Dialogs from Resources
Posted: Wed Sep 30, 2015 11:23 AM
Ok, as explained by Cristobal to me, Windows does not support UTF8. Only Unicode.

So you have to open the RC file with notepad.exe and save it with Unicode format.

Cristobal, thanks for the finding :-)

And don't forget to add this at the beginning of your PRG:

FW_SetUnicode( .T. )
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Unicode Support to Dialogs from Resources
Posted: Wed Sep 30, 2015 11:27 AM
And it seems as brc32.exe can not be used, instead we have to use cgrc.exe from Embarcadero.

In buildh.bat this change is needed:

Instead of:

IF EXIST %1.rc %bcdir%\bin\brc32.exe -r -I%bcdir%\include -I%bcdir%\include\windows\sdk %1

We must use:

IF EXIST %1.rc %bcdir%\bin\cgrc.exe -r -m -I%bcdir%\include -I%bcdir%\include\windows\sdk %1
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Unicode Support to Dialogs from Resources
Posted: Wed Sep 30, 2015 12:12 PM

As Embarcadero does not allow the redistribution of these (free) tools, if you are interested

about using cgrc.exe please send me a gmail account if you want to receive the instructions about how to download the software

from Embarcadero and where this tool is located

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 654
Joined: Fri Oct 21, 2005 05:54 AM
Re: Unicode Support to Dialogs from Resources
Posted: Wed Sep 30, 2015 12:31 PM
Dear Mr.Antinio,

I am extremely happy for that I could
get the Unicode resource dialogs shown
properly with unicode characters, with
your great help.

cgrc.exe and saving the .rc file with in
unicode format has done the magic.


windows 7 print screen

Thank you very much to you and Mr.Cristobal

Regards,

-Ramesh Babu P
Posts: 1598
Joined: Fri Oct 07, 2005 05:56 PM
Re: Unicode Support to Dialogs from Resources
Posted: Thu Oct 01, 2015 02:33 AM
Dear Antonio,

I do interest too, thank you in advance.
dutchez4 @ gmail.com
Antonio Linares wrote:As Embarcadero does not allow the redistribution of these (free) tools, if you are interested

about using cgrc.exe please send me a gmail account if you want to receive the instructions about how to download the software

from Embarcadero and where this tool is located
Regards,

Dutch



FWH 2304 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio

FWPPC 10.02 / Harbour for PPC (FTDN)

ADS V.9 / MySql / MariaDB

R&R 12 Infinity / Crystal Report XI R2

(Thailand)
Posts: 866
Joined: Tue Oct 16, 2007 08:57 AM
Re: Unicode Support to Dialogs from Resources
Posted: Thu Oct 01, 2015 05:23 AM
Dear Antonio,

1.Resource Dialog not work. I can't input Chinese word and number into TGet.
2.ToolTip display Garbled.
Best Regards,



Richard



Harbour 3.2.0dev (r2503251254) => Borland C++ v7.7 32bit

MySQL v8.0

Harbour 3.2.0dev (r2503251254) => Borland C++ v7.7 64bit
Posts: 654
Joined: Fri Oct 21, 2005 05:54 AM
Re: Unicode Support to Dialogs from Resources
Posted: Thu Oct 01, 2015 06:32 AM
Hello Mr.Richard

The dialog what I have shown above is generated using your source only.

Plz. follow the instructions give by Mr.Antonio. I reiterate them once again
for you.

A) In the begenning of you main program, you have to write FW_SetUnicode(.T.)
B) You plase copy your .RC file contents into notepad and save it as "unicode" not "UTF-8"
C) Copy cgrc.exe into BCC7\BIN or BCC582\BIN
D) In Buildx.bat say :

Code (fw): Select all Collapse
    rem IF EXIST %1.rc %bcdir%\bin\brc32 -r -I%bcdir%\include %1
    IF EXIST %1.rc %bcdir%\bin\cgrc -r -m -ipath%bcdir%\include %1

E) Just compile and link it. You will get the .EXE properly built and working with UNICODE support.

In case you need the .EXE generated from your own code you gave me, plz. write to my private mail.
I will send it to you.

Thats all

Regards,

-Ramesh Babu