|
From: Baloghy G. <bal...@gm...> - 2014-09-27 09:51:56
|
Hi,
I have an orginally clipper, later harbour (gtvwt) application.I try
it to transform to a gui application with hwgui.
My dbf tables are in HU852 codepage. I try to use the
SET(_SET_DBCODEPAGE,"HU852") command, but the text in the the say /
get gui elements are wrong.
Could you help me, what is missing from my sample program?
Regard,
Gabor
#include "windows.ch"
#include "guilib.ch"
REQUEST HB_CODEPAGE_HU852
REQUEST HB_LANG_HU852
FUNCTION MAIN
HB_LANGSELECT("HU852")
SET(_SET_CODEPAGE,"HU852")
SET(_SET_DBCODEPAGE,"HU852")
use table
init dialog oTest852 title "Test" size 600,400
x:=table->abcd
@ 20,20 say x size 300,25
@ 20,50 get x size 300,25
activate dialog oTest852 center
return
|
|
From: Alexander S.K. <al...@be...> - 2014-10-03 10:40:25
|
I don't know, how it is with Hungarian, but for Russian there are
different codepages for DOS and Windows applications, so in GUI programs
I set one codepage for an application ( _SET_CODEPAGE ) and other for
databases, because they are inherited from old times.
So, probably, you need to set a HUWIN as an application codepage.
I didn't know that _SET_CODEPAGE and _SET_DBCODEPAGE were added, so I use
hb_cdpSelect( "RU1251" ) // Win (ANSI) codepage for an application
...
use table codepage "RU866" // DOS (OEM) codepage for a table
Regards, Alexander.
Baloghy Gábor:
> Hi,
>
> I have an orginally clipper, later harbour (gtvwt) application.I try
> it to transform to a gui application with hwgui.
>
> My dbf tables are in HU852 codepage. I try to use the
> SET(_SET_DBCODEPAGE,"HU852") command, but the text in the the say /
> get gui elements are wrong.
>
> Could you help me, what is missing from my sample program?
>
> Regard,
>
> Gabor
>
>
> #include "windows.ch"
> #include "guilib.ch"
> REQUEST HB_CODEPAGE_HU852
> REQUEST HB_LANG_HU852
>
> FUNCTION MAIN
>
> HB_LANGSELECT("HU852")
> SET(_SET_CODEPAGE,"HU852")
> SET(_SET_DBCODEPAGE,"HU852")
>
> use table
>
> init dialog oTest852 title "Test" size 600,400
>
> x:=table->abcd
>
> @ 20,20 say x size 300,25
> @ 20,50 get x size 300,25
>
> activate dialog oTest852 center
>
> return
>
> ------------------------------------------------------------------------------
> Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
> Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
> Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
> Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
> http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
> _______________________________________________
> Hwgui-developers mailing list
> Hwg...@li...
> https://lists.sourceforge.net/lists/listinfo/hwgui-developers
>
|
|
From: Przemyslaw C. <dr...@po...> - 2014-10-03 12:11:10
|
Hi,
In Harbour hb_cdpSelect( [ <cCPID> ] ) is the same
as SET( _SET_CODEPAGE [, <cCPID> ] )
If you compile HWGUI for Windows with UNICODE macro flag then
you can use any encoding in your source code, i.e. "RU866".
All what you have to do is informing HVM about used CP
by _SET_CODEPAGE.
If you do not use UNICODE macro in HWGUI windows builds or
it's Linux GTK build then you also can use any encoding but
additionally you have to inform HVM about CP used in system
calls by _SET_OSCODEPAGE, i.e.:
// set CP for source code and HVM internal string encoding
SET( _SET_CODEPAGE, "RU866" )
#ifdef __PLATFROM__LINUX
SET( _SET_OSCODEPAGE, "UTF8" )
#else
SET( _SET_OSCODEPAGE, "RU1251" )
#endif
In summary current Harbour versions does not force any encoding
regardless of used system and UI library. It's only important
that the libraries like HWGUI use Harbour STR API instead of
old Clipper like hb_parc()/hb_retc()/hb_storc()/...
When new API is used then all translations are made automatically
by HVM and user can work with anu encoding he prefers.
best regards,
Przemek
On Fri, 03 Oct 2014, Alexander S.Kresin wrote:
> I don't know, how it is with Hungarian, but for Russian there are
> different codepages for DOS and Windows applications, so in GUI programs
> I set one codepage for an application ( _SET_CODEPAGE ) and other for
> databases, because they are inherited from old times.
>
> So, probably, you need to set a HUWIN as an application codepage.
>
> I didn't know that _SET_CODEPAGE and _SET_DBCODEPAGE were added, so I use
>
> hb_cdpSelect( "RU1251" ) // Win (ANSI) codepage for an application
> ...
> use table codepage "RU866" // DOS (OEM) codepage for a table
>
> Regards, Alexander.
>
> Baloghy Gábor:
> > Hi,
> >
> > I have an orginally clipper, later harbour (gtvwt) application.I try
> > it to transform to a gui application with hwgui.
> >
> > My dbf tables are in HU852 codepage. I try to use the
> > SET(_SET_DBCODEPAGE,"HU852") command, but the text in the the say /
> > get gui elements are wrong.
> >
> > Could you help me, what is missing from my sample program?
> >
> > Regard,
> >
> > Gabor
> >
> >
> > #include "windows.ch"
> > #include "guilib.ch"
> > REQUEST HB_CODEPAGE_HU852
> > REQUEST HB_LANG_HU852
> >
> > FUNCTION MAIN
> >
> > HB_LANGSELECT("HU852")
> > SET(_SET_CODEPAGE,"HU852")
> > SET(_SET_DBCODEPAGE,"HU852")
> >
> > use table
> >
> > init dialog oTest852 title "Test" size 600,400
> >
> > x:=table->abcd
> >
> > @ 20,20 say x size 300,25
> > @ 20,50 get x size 300,25
> >
> > activate dialog oTest852 center
> >
> > return
> >
> > ------------------------------------------------------------------------------
> > Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
> > Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
> > Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
> > Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
> > http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
> > _______________________________________________
> > Hwgui-developers mailing list
> > Hwg...@li...
> > https://lists.sourceforge.net/lists/listinfo/hwgui-developers
> >
>
>
> ------------------------------------------------------------------------------
> Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
> Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
> Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
> Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
> http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
> _______________________________________________
> Hwgui-developers mailing list
> Hwg...@li...
> https://lists.sourceforge.net/lists/listinfo/hwgui-developers
|
|
From: Alexander S.K. <al...@be...> - 2014-10-07 11:16:49
|
Przemyslaw Czerpak writes: > > // set CP for source code and HVM internal string encoding > SET( _SET_CODEPAGE, "RU866" ) > #ifdef __PLATFROM__LINUX > SET( _SET_OSCODEPAGE, "UTF8" ) > #else > SET( _SET_OSCODEPAGE, "RU1251" ) > #endif > > In summary current Harbour versions does not force any encoding > regardless of used system and UI library. It's only important > that the libraries like HWGUI use Harbour STR API instead of > old Clipper like hb_parc()/hb_retc()/hb_storc()/... > When new API is used then all translations are made automatically > by HVM and user can work with anu encoding he prefers. > Thanks for the explanation. The _SET_OSCODEPAGE was news for me. Which functions includes this STR API ? Regards, Alexander. |
|
From: Przemyslaw C. <dr...@po...> - 2014-10-07 14:23:47
|
On Tue, 07 Oct 2014, Alexander S.Kresin wrote:
Hi,
> > // set CP for source code and HVM internal string encoding
> > SET( _SET_CODEPAGE, "RU866" )
> > #ifdef __PLATFROM__LINUX
> > SET( _SET_OSCODEPAGE, "UTF8" )
> > #else
> > SET( _SET_OSCODEPAGE, "RU1251" )
> > #endif
> > In summary current Harbour versions does not force any encoding
> > regardless of used system and UI library. It's only important
> > that the libraries like HWGUI use Harbour STR API instead of
> > old Clipper like hb_parc()/hb_retc()/hb_storc()/...
> > When new API is used then all translations are made automatically
> > by HVM and user can work with anu encoding he prefers.
> Thanks for the explanation. The _SET_OSCODEPAGE was news for me.
> Which functions includes this STR API ?
In practice all string functions have corresponding ones working with
automatic translation. They are defined in src/vm/strapi.c and header
files for them is hbapistr.h:
hb_item{Get,Put,Copy}Str[Len]*(),
hb_array{Get,Sut}Str[Len]*(),
hb_parstr*(), hb_parsstr*(), hb_retstr[len]*(), hb_storstr[len]*()
In hbwinuni.h we have macros which in MS-Windows builds chose Unicode or
ANSI functions depending on UNICODE macro.
Few years ago I adopted nearly whole HWGUI code for windows to use this
macros. I do not know if it was changed later.
For *nix builds we can also use such macros, i.e. in Harbour
contrib/sddodbc/core.c such macros are defined for all builds
so they work in Windows, Linux and other systems. Probably it
would be good to move multiplatform macros from hbwinuni.h
to more generic file which can be included in all platforms.
I'll do that soon. Of course for Linux only code you can use
functions defined in hbapistr.h directly.
best regards,
Przemek
|