STRU - Lists and modifies the structure of the dbfs files
Moderator: Rathinagiri
- Pablo César
- Posts: 4059
- Joined: Wed Sep 08, 2010 1:18 pm
- Location: Curitiba - Brasil
STRU - Lists and modifies the structure of the dbfs files
Mr. Esgici, you always are very kind and a gentleman ! Thank you !
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
Re: STRU - Lists and modifies the structure of the dbfs file
Hi Pablo!
I want to report some problems/bugs with Polish.
When opening in text mode, you should use commands:
You should set as below in graphics mode:
I've modified stru.prg in this way:
everything looks good both in text and graphics mode.
I'm attaching polish.lng and polish.tln in zip file
I want to report some problems/bugs with Polish.
When opening in text mode, you should use commands:
Code: Select all
SET LANGUAGE TO POLISH
HB_CDPSELECT("PL852")
Code: Select all
SET LANGUAGE TO POLISH
HB_CDPSELECT("PLWIN")
Code: Select all
Case Upper(IDIOMA)="POLISH"
SET LANGUAGE TO POLISH
SET CODEPAGE TO POLISH
HB_CDPSELECT("PL852")
I'm attaching polish.lng and polish.tln in zip file
- Attachments
-
- polish.zip
- (3.54 KiB) Downloaded 364 times
Re: STRU - Lists and modifies the structure of the dbfs file
Hi All !
.
.
.
I think the better solution will bet set unicode support to this app...
A first step to do this: below ( if works: then delete any other reference like Language or Codepage )
.
.
.
.
.
.
.
.
Best regards
.
.
.
I think the better solution will bet set unicode support to this app...
A first step to do this: below ( if works: then delete any other reference like Language or Codepage )
.
.
.
.
.lng files need to be saved as unicode for corrrect screen show
.
.
Code: Select all
//*----------------------------------------------------------------------------*
//
// M., Ronaldo: 2012/10/09
//
// Class: Unicode support to Harbour app´s
//
//*----------------------------------------------------------------------------*
STATIC PROCEDURE MR_Set_Lang_and_CP()
/* Terminal and OS codepage */
hb_SetTermCP( hb_cdpTerm() )
Set( _SET_OSCODEPAGE, hb_cdpOS() )
/* Set language for Gui */
hb_langSelect( hb_UserLang(), "UTF8EX" )
hb_cdpSelect( "UTF8EX" )
? hb_langname()
RETURN
.
.
Best regards
M., Ronaldo
By: IMATECH
Imation Tecnologia
By: IMATECH
Imation Tecnologia
- Pablo César
- Posts: 4059
- Joined: Wed Sep 08, 2010 1:18 pm
- Location: Curitiba - Brasil
STRU - Lists and modifies the structure of the dbfs files
I have tried but unsuccessfully. It is compiling without error, error only happening at runtime displaying:
So, I need to know what I am doing wrong...
I suppose that need to add #include "hbapilng.h" but another errors is coming by this include: C:\hmg.3.0.44\harbour\include\hbdefs.h(56) Error F0029 Can't open #include file 'stdarg.h'So, I need to know what I am doing wrong...
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
Re: STRU - Lists and modifies the structure of the dbfs file
Are you using HMG 3.0.44 ?
If Yes: Try this code:
If Yes: Try this code:
//*----------------------------------------------------------------------------*
// PROCEDURE MAIN( ... )
//*----------------------------------------------------------------------------*
PROCEDURE MAIN( ... )
...
*---------------------------------------------------------------------------*
* HMG MESSAGES - PT_BR ( uncomment for test purposes )
*---------------------------------------------------------------------------*
// SET LANGUAGE TO PORTUGUESE
// SET CODEPAGE TO PORTUGUESE
*---------------------------------------------------------------------------*
* UNICODE SUPPORT
*---------------------------------------------------------------------------*
MR_Set_Lang_and_CP()
...
RETURN
//*----------------------------------------------------------------------------*
// HB_GTSYS()
//*----------------------------------------------------------------------------*
PROCEDURE HB_GTSYS()
REQUEST HB_LANG_PT
REQUEST HB_CODEPAGE_PT850
RETURN
M., Ronaldo
By: IMATECH
Imation Tecnologia
By: IMATECH
Imation Tecnologia
- Pablo César
- Posts: 4059
- Joined: Wed Sep 08, 2010 1:18 pm
- Location: Curitiba - Brasil
Re: STRU - Lists and modifies the structure of the dbfs file
YesChacal.GO wrote:Are you using HMG 3.0.44 ?
I have tested by your tow indications, taking off (making like comments) like as:
// SET LANGUAGE TO PORTUGUESE
// SET CODEPAGE TO PORTUGUESE
then
MR_Set_Lang_and_CP()
But the result is not correct displayed when STRU is in console mode. Even using:
cText_to_be_displayed := hb_translate( cStr, "PT850", "UTF8") The strange is when I try to use by this way:
cText_to_be_displayed := hb_translate( cStr, hb_UserLang(), "UTF8") // this is with error when try to compile.
Anyway seems is not going to work properly even lng files been in Unicode.
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
Re: STRU - Lists and modifies the structure of the dbfs file
Hi Pablo !
Why are you using hb_translate ?
Just use sources and .lng files saved as Unicode...
Any modern editor support this feature...
cText_to_be_displayed := cStr
Alert( cText_to_be_displayed )
Why are you using hb_translate ?
Just use sources and .lng files saved as Unicode...
Any modern editor support this feature...
cText_to_be_displayed := cStr
Alert( cText_to_be_displayed )
M., Ronaldo
By: IMATECH
Imation Tecnologia
By: IMATECH
Imation Tecnologia
- Pablo César
- Posts: 4059
- Joined: Wed Sep 08, 2010 1:18 pm
- Location: Curitiba - Brasil
STRU - Lists and modifies the structure of the dbfs file
Because my files is still in Ansi mode. This function should not translate to Unicode ?Chacal.GO wrote:Why are you using hb_translate ?
I made your sugestion. I saved portuguese.lng in UTF-8 format. But now is with another kind of error. Does not recognize "&"... see error:Just use sources and .lng files saved as Unicode...
Any modern editor support this feature...
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
Re: STRU - Lists and modifies the structure of the dbfs file
Hi Pablo !
I have downloaded your project for case study....
When understand core logic will make some tests, and give a new reply...
regards...
I have downloaded your project for case study....
When understand core logic will make some tests, and give a new reply...
regards...
M., Ronaldo
By: IMATECH
Imation Tecnologia
By: IMATECH
Imation Tecnologia
Re: STRU - Lists and modifies the structure of the dbfs file
Hi Pablo !
My 1st choice was not to use HB_TRANSLATE(), but whithout this I can't make this sample work correctly
Below a minimal sample for correct use of Ansi Files to UTF8
My 1st choice was not to use HB_TRANSLATE(), but whithout this I can't make this sample work correctly
Below a minimal sample for correct use of Ansi Files to UTF8
Code: Select all
//
// HBMK2 file.prg -gtwin -gui
//
REQUEST HB_LANG_PT
REQUEST HB_CODEPAGE_UTF8
PROCEDURE Main()
LOCAL cFile
LOCAL cText
/* Set language for Screen */
hb_langSelect( hb_UserLang(), "UTF8EX" )
hb_cdpSelect( "UTF8EX" )
/* Terminal and OS codepage */
// hb_SetTermCP( "UTF8EX" )
hb_SetTermCP( hb_cdpTerm() )
Set( _SET_OSCODEPAGE, hb_cdpOS() )
SETMODE( 62, 164 )
CLS
cFile := 'English.Lng'
cText := MemoRead( cFile )
alert( cFile + ';;' + HB_TRANSLATE( cText ,"EN", "UTF8" ) )
cFile := 'French.Lng'
cText := MemoRead( cFile )
alert( cFile + ';;' + HB_TRANSLATE( cText ,"FRISO", "UTF8" ) )
cFile := 'Italian.Lng'
cText := MemoRead( cFile )
alert( cFile + ';;' + HB_TRANSLATE( cText ,"ITISO", "UTF8" ) )
cFile := 'Polish.lng'
cText := MemoRead( cFile )
alert( cFile + ';;' + HB_TRANSLATE( cText ,"PLWIN", "UTF8" ) )
cFile := 'Portuguese.Lng'
cText := MemoRead( cFile )
alert( cFile + ';;' + HB_TRANSLATE( cText ,"PTISO", "UTF8" ) )
cFile := 'Spanish.Lng'
cText := MemoRead( cFile )
alert( cFile + ';;' + HB_TRANSLATE( cText ,"ESISO", "UTF8" ) )
cFile := 'Turkish.Lng'
cText := MemoRead( cFile )
alert( cFile + ';;' + HB_TRANSLATE( cText ,"TRWIN", "UTF8" ) )
RETURN
M., Ronaldo
By: IMATECH
Imation Tecnologia
By: IMATECH
Imation Tecnologia