code page 852 in console mode

Issues and Discussions related to Harbour

Moderator: Rathinagiri

Post Reply
majkll_ns
Posts: 16
Joined: Sun Oct 24, 2010 12:50 pm

code page 852 in console mode

Post 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
edk
Posts: 909
Joined: Thu Oct 16, 2014 11:35 am
Location: Poland

Re: code page 852 in console mode

Post 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')
majkll_ns
Posts: 16
Joined: Sun Oct 24, 2010 12:50 pm

Re: code page 852 in console mode

Post 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? :)
edk
Posts: 909
Joined: Thu Oct 16, 2014 11:35 am
Location: Poland

Re: code page 852 in console mode

Post 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
Bez tytułu.png (5.15 KiB) Viewed 4238 times
edk
Posts: 909
Joined: Thu Oct 16, 2014 11:35 am
Location: Poland

Re: code page 852 in console mode

Post 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
Bez tytułu.png (4.34 KiB) Viewed 4231 times
majkll_ns
Posts: 16
Joined: Sun Oct 24, 2010 12:50 pm

Re: code page 852 in console mode

Post by majkll_ns »

You are right.
It works for me to.

Thanks again!
Post Reply