Jump to content
Fivewin Brasil

Definir corretamente hb_lang e hb_codepage


ram_bh

Recommended Posts

Bom dia!

Estou com dificuldade em acertar ou escolher adequadamente o valor do codepage.

Estou utilizando:

FWSetLanguage(4)

Request HB_Lang_PT

HB_LangSelect("PT")

Request HB_CodePage_PT850

HB_SetCodePage( "PT850" )

 

Desta forma, ao utilizar a função CDOW(Date()), o nome do dia da semana não é exibido corretamente - o 'ç' não é exibido em 'terça-feira'.

O que está errado ou faltando?

Obrigado!

Rodrigo Melo

Belo Horizonte / MG

FWH 17.09 / xHarbour / BCC7.30

 

Link to comment
Share on other sites

#include "FiveWin.ch"
	static oWnd
	REQUEST HB_LANG_PT
REQUEST HB_CODEPAGE_PT850
	FUNCTION Main()
	   LOCAL oBar
	   HB_LANGSELECT( 'PT' )     // Default language is now Portuguese
   HB_SETCODEPAGE( "PT850" )
	   FWSetLanguage(4)
	   DEFINE WINDOW oWnd TITLE "Linguagem"
	   DEFINE BUTTONBAR oBar _3D OF oWnd
	   DEFINE BUTTON OF oBar ACTION( Linguagem() )
	   SET MESSAGE OF oWnd TO "Linguagem" NOINSET CLOCK DATE KEYBOARD
	   ACTIVATE WINDOW oWnd
	RETURN NIL
	FUNCTION Linguagem()
	   LOCAL cAcento
	   cAcento := CDOW(Date())
	   // Harbou y xHarbour
   ? OemToAnsi( cAcento )     // Correto vem Oem
	   // ? AnsiToOem( cAcento )  // Incorreto
	RETURN NIL


 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...