Page 1 of 1
code page 852 in console mode
Posted: Thu Dec 14, 2017 8:54 pm
by majkll_ns
I need to reactivate an old program.
I use hmg 3.4.4 and compile it with build /c and everything is fine except it shows english character set on screen.
is there any way to set code page 852?
trying with
set codepage to slovenian - not help (seems that this set cp1250)
hb_cdpSelect( "SL852" ) - not help: argumet error
Re: code page 852 in console mode
Posted: Thu Dec 14, 2017 9:08 pm
by edk
Try this:
Code: Select all
#include "hblang.ch"
REQUEST HB_LANG_SL852
request HB_CODEPAGE_SL852
SET LANGUAGE TO SLOVENIAN
set( _SET_CODEPAGE, "SL852" )
hb_LangSelect( 'SL852')
Re: code page 852 in console mode
Posted: Thu Dec 14, 2017 9:40 pm
by majkll_ns
Thanh you very, very much !!
I need just to add one more line, so solution is:
#include <i_lang.ch>
#include "hblang.ch"
REQUEST HB_LANG_SL852
request HB_CODEPAGE_SL852
SET LANGUAGE to SLOVENIAN
set( _SET_CODEPAGE, "SL852" )
hb_LangSelect( 'SL852')
Now, i ONLY need to find solution for keyboard maping...
Any sugestions?

Re: code page 852 in console mode
Posted: Thu Dec 14, 2017 10:08 pm
by edk
I do not understand very much. You mean national characters?
In the Polish version of Windows there is no problem with the keyboard, I can set two modes in the system: Polish programmer - the characters are obtained with right ALT pressed or Polish typists for a dedicated keyboard layout.
When you run the windows console via cmd.exe, do not you see national characters?

- Bez tytułu.png (5.15 KiB) Viewed 4998 times
Re: code page 852 in console mode
Posted: Thu Dec 14, 2017 10:34 pm
by edk
I set up the Slovenian keyboard in the system and there is no problem with entering national characters.
Here is the code that works for me:
Code: Select all
REQUEST HB_GT_WIN_DEFAULT
#include <i_lang.ch>
#include "hblang.ch"
REQUEST HB_LANG_SL852
request HB_CODEPAGE_SL852
function Main()
Local cTest := SPACE(40)
SET LANGUAGE TO SLOVENIAN
set( _SET_CODEPAGE, "SL852" )
hb_LangSelect( 'SL852')
SetMode(25,80)
CLS
@ 10,10 say 'Hello'
@ 12,10 GET cTest
READ
@ 14,10 Say cTest
alert('Hello')
return nil

- Bez tytułu.png (4.34 KiB) Viewed 4991 times
Re: code page 852 in console mode
Posted: Fri Dec 15, 2017 12:57 am
by majkll_ns
You are right.
It works for me to.
Thanks again!