UPPPER() function doesn't work with Greek Characters

Issues and Discussions related to Harbour

Moderator: Rathinagiri

User avatar
quartz565
Posts: 667
Joined: Mon Oct 01, 2012 12:37 pm
Location: Thessaloniki, Greece
Contact:

UPPER() function doesn't work with Greek Characters

Post by quartz565 »

Hi all

UPPER() Function doesn't work with Greek characters (no problem with english char)
Any help please ?


REQUEST HB_CODEPAGE_ELWIN
SET CODEPAGE TO GREEK

cPromhNew := alltrim(UPPER(cPromh))


(doesn't work)

Nikos
Best Regards,
Nikos.

os: Windows Server 2019 - 64
User avatar
esgici
Posts: 4543
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Contact:

Re: UPPPER() function doesn't work with Greek Characters

Post by esgici »

Hi Nikos
quartz565 wrote:Hi all

UPPER() Function doesn't work with Greek characters (no problem with english char)
Any help please ?

REQUEST HB_CODEPAGE_ELWIN
SET CODEPAGE TO GREEK

cPromhNew := alltrim(UPPER(cPromh))


(doesn't work)

Nikos
Found this in Harbour changelog :
2012-03-13 12:55 UTC+0100 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
...
* harbour/src/rtl/cdpapi.c
+ added new C functions hb_cdpnDupUpper(), hb_cdpnDupLower(),
hb_cdpnDup2Upper() and hb_cdpnDup2Lower().
They should be used instead of hb_strUpper() and hb_strLower()
functions because they can work well with CPs where upper and
lower characters uses different number of bytes, i.e. UTF8 has
such characters.
Please try this new functions and please inform us about result.

Regards
Viva INTERNATIONAL HMG :D
User avatar
quartz565
Posts: 667
Joined: Mon Oct 01, 2012 12:37 pm
Location: Thessaloniki, Greece
Contact:

Re: UPPPER() function doesn't work with Greek Characters

Post by quartz565 »

Dear esgici

I have used the functions you have suggested but they are not recognized. I have also found the cdpapi.c file, but I have no success in making HARBOUR use it.
Could you please tell me how to use it? Where to place it? Etc.

Regards
Nikos
Best Regards,
Nikos.

os: Windows Server 2019 - 64
User avatar
esgici
Posts: 4543
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Contact:

Re: UPPPER() function doesn't work with Greek Characters

Post by esgici »

OK Niko,

Please don't worry,

I'll search and hopefully find a way.

Regards
Viva INTERNATIONAL HMG :D
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

Re: UPPPER() function doesn't work with Greek Characters

Post by Pablo César »

Please accept one palliative suggestion while it is not solution an academic solution:

You can create your own function, I means to make My_Upper() putting Upper and Lower characters in different Arrays, then you can translate one by one.
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
User avatar
esgici
Posts: 4543
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Contact:

Re: UPPPER() function doesn't work with Greek Characters

Post by esgici »

Hi Nikos

Sorry, I don't neither learn nor understand this UTF8 "gadget" :(

And a little confused by your request :?

Does UPPER() function was work for non-english characters earlier ( in Clipper or Harbour before UTF8 ) :?:

I guess no.

There was here a little work includes UDFs for "national" UPPER and LOWER().

Please look at it and please inform me if your problem persist .

Regards
Viva INTERNATIONAL HMG :D
User avatar
quartz565
Posts: 667
Joined: Mon Oct 01, 2012 12:37 pm
Location: Thessaloniki, Greece
Contact:

Re: UPPPER() function doesn't work with Greek Characters

Post by quartz565 »

Hi esgici

The UPPER function worked OK in the Clipper (DOS) enviroment with CP737 (DOS GREEK CHRs). Nothing has worked in the Windows enviroment

Nikos
Best Regards,
Nikos.

os: Windows Server 2019 - 64
User avatar
quartz565
Posts: 667
Joined: Mon Oct 01, 2012 12:37 pm
Location: Thessaloniki, Greece
Contact:

Re: UPPPER() function doesn't work with Greek Characters

Post by quartz565 »

Hi Pablo

Thanks for you suggestion. I will have to do this If I can not find something already available.


Regards,
Nikos
Best Regards,
Nikos.

os: Windows Server 2019 - 64
User avatar
quartz565
Posts: 667
Joined: Mon Oct 01, 2012 12:37 pm
Location: Thessaloniki, Greece
Contact:

Re: UPPPER() function doesn't work with Greek Characters

Post by quartz565 »

I would like to add, that the objects used for compiling with clipper (DOS) include msggr437 and ntxgr437 for greek environment
Best Regards,
Nikos.

os: Windows Server 2019 - 64
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

Re: UPPPER() function doesn't work with Greek Characters

Post by Pablo César »

Hi Nikos !

I do not know if your case is UPPER it does not work correct at all or if It's working but completly with all characters. Your app is in console or GUI mode ?

If is for console mode, we use Hb_AnsiToOem() for portuguese accents, after SET LANGUAGE TO PORTUGUESE and SET CODEPAGE TO PORTUGUESE
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
Post Reply