Testing out GET and UTF-8

180 views
Skip to first unread message

oscar.r...@gmail.com

unread,
Aug 28, 2025, 9:43:29 AM (8 days ago) Aug 28
to Harbour Users
Hello!
This is related to my previous inquiry regarding the usage of UTF-8 in Harbour. See, the GET command seems to be working strangely when I have UTF-8 set in the program. Instead of the corresponding characters like ñ, á, é, etc, I'm getting hearts. The entire system is set in UTF-8 and this is the main source of trouble. Onscreen characters set with @ look correct but when it comes to GET, it behaves completely different. Has anyone figured out a workaround? Here is the code of the test program below, a screenshot of the GET and the printed string.
Thanks in advance.

PROCEDURE Main()

local bb:=space(10)
local getlist:={}

HB_CDPSELECT("UTF8")


@ 10,2 get bb
read

? bb


prueba_get_utf8.jpg

♥♥♥aa

Alain Aupeix

unread,
Aug 28, 2025, 1:21:05 PM (8 days ago) Aug 28
to Harbour Users
Hi, I don't know if you're under Windows, but under linux same problem.

@ x,y say "éèç" => ok
@ x,y get bb => with string "éèà" => ♥♥♥

But using hwgui, no problem:

-----------------------------------------------------------------------------
#include "hwgui.ch"

REQUEST HB_CODEPAGE_UTF8

function Main()

local bb:=space(10), oInit
local getlist:={}

HB_CDPSELECT("UTF8")
hwg_SetApplocale( "UTF8" )

INIT DIALOG oInit NOEXIT TITLE "Test" AT 145,165 SIZE 140,100

@  5,2 say "éèç" size 50,32
@ 5,30 get bb  size 50,32

ACTIVATE DIALOG oInit

return nil
-------------------------------------------------------------------------------------------


Curious ... so harbour problem ?

A+

M., Ronaldo

unread,
Aug 28, 2025, 1:50:45 PM (7 days ago) Aug 28
to Harbour Users
MS Win10/ Win11, All looks ok

REQUEST HB_CODEPAGE_UTF8

Proc Main()
local ca
local cb
local getlist:={}

cls

HB_CDPSELECT("UTF8")

SetMode( 16, 40 )

ca := Space( 10 )
cb := 'ñáéèç     '

@ 5,2 say 'get ca ' get ca
@ 7,2 say 'get cb ' get cb

read

@ 10,2 say 'say ca [' + ca + ']'
@ 12,2 say 'say cb [' + cb + ']'

Inkey(0)

Capturar.JPG

oscar.r...@gmail.com

unread,
Aug 28, 2025, 4:28:22 PM (7 days ago) Aug 28
to Harbour Users
So sorry! I forgot to mention the OS! Yes, we're in Linux Ubuntu. We don't have that hwgui.ch in our include folder here. Where can we get it?

Francesco Perillo

unread,
Aug 29, 2025, 1:17:25 AM (7 days ago) Aug 29
to harbou...@googlegroups.com
Can you please post this snippet somewhere we can download from so we start from a correctly encoded source code?

@Oscar are you sure that the terminal is correctly set to utf-8?

--
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
Unsubscribe: harbour-user...@googlegroups.com
Web: https://groups.google.com/group/harbour-users
---
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbour-user...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/harbour-users/702bfad1-1406-4be8-b85f-5eeee901591dn%40googlegroups.com.

Alain Aupeix

unread,
Aug 29, 2025, 2:52:32 AM (7 days ago) Aug 29
to harbou...@googlegroups.com, Francesco Perillo


Le 29/08/2025 à 07:17, Francesco Perillo a écrit :
Can you please post this snippet somewhere we can download from so we start from a correctly encoded source code?

@Oscar are you sure that the terminal is correctly set to utf-8?

You're perhaps right for windows, but it can't be the case under linux, so I confirm that's an harbour problem.

Trying under linux, I had the same result, but entering the same string in ca, the problem is here

A+


A+

To view this discussion visit https://groups.google.com/d/msgid/harbour-users/CADPHLr9qwFHw7pNfjOMuVHwF3TKtscYepkGxxTHuSo957pndaw%40mail.gmail.com.
--

Alain Aupeix
Sites web : JujuLand | Pissobi-Lacassagne | Gadel
X.ubuntu 16.04 | H.arbour 3.2.0-1 (r2024-09-14 21:26) | Hw.gui 2.23-8dev (r3481) | G.ramps 5.1.2


test.prg

Alain Aupeix

unread,
Aug 29, 2025, 3:08:44 AM (7 days ago) Aug 29
to harbou...@googlegroups.com, oscar.r...@gmail.com


Le 28/08/2025 à 22:28, oscar.r...@gmail.com a écrit :
So sorry! I forgot to mention the OS! Yes, we're in Linux Ubuntu. We don't have that hwgui.ch in our include folder here. Where can we get it?

Hi,

I'm under Xubuntu.

it's an include file to build applications using hwgui.

Hou can download hwgui source here and build : svn co http://svn.code.sf.net/p/hwgui/code/trunk

But you can also download and install a tool I made to build harbour or hwgui applications under Linux :

https://sourceforge.net/projects/hwmake/files/

If you need help to install and use HwMake for Linux, I will help you.

HwGui is a nice addon to harbour.

A+

--


Alain Aupeix
X.ubuntu 16.04 | H.arbour 3.2.0-1 (r2025-08-22 10:00) | Hw.gui 2.23-8dev (r3490) | G.ramps 5.1.2

Alex Strickland

unread,
Aug 29, 2025, 7:12:43 AM (7 days ago) Aug 29
to harbou...@googlegroups.com
Hi

What is the difference between UTF8 and UTF8EX in Harbour?

--

Regards

Alex


oscar.r...@gmail.com

unread,
Aug 29, 2025, 9:20:47 AM (7 days ago) Aug 29
to Harbour Users
Francesco: Yes, the terminal is set to UTF-8, the prg files are encoded in UTF-8, everything is in UTF-8. Except the GET which doesn't seem to tolerate UTF-8 characters.
Alain, I am very interested in HwMake. I'll try to install it and if I come up with any questions, I'll make sure to ask.
Alex, I don't know, but I think it's related to BOM. 
Regards,
Oscar

Zastava EFI

unread,
Sep 4, 2025, 8:08:12 AM (17 hours ago) Sep 4
to harbou...@googlegroups.com
Hello,

I had a similar problem with displaying national dialect characters. The only thing you can do is translate them on the fly into what you need to display. It works for me.

example :

function FAConv(aConv) 

         aConv:=strTran(aConv,[&],[A])
  

return ( aConv)


--
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
Unsubscribe: harbour-user...@googlegroups.com
Web: https://groups.google.com/group/harbour-users
---
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbour-user...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages