Page 1 of 2

UPPER() function doesn't work with Greek Characters

Posted: Mon Nov 12, 2012 10:59 pm
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

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

Posted: Mon Nov 12, 2012 11:26 pm
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

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

Posted: Tue Nov 13, 2012 12:04 pm
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

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

Posted: Tue Nov 13, 2012 12:20 pm
by esgici
OK Niko,

Please don't worry,

I'll search and hopefully find a way.

Regards

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

Posted: Tue Nov 13, 2012 3:55 pm
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.

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

Posted: Tue Nov 13, 2012 3:58 pm
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

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

Posted: Wed Nov 14, 2012 11:43 am
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

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

Posted: Wed Nov 14, 2012 11:46 am
by quartz565
Hi Pablo

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


Regards,
Nikos

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

Posted: Wed Nov 14, 2012 12:12 pm
by quartz565
I would like to add, that the objects used for compiling with clipper (DOS) include msggr437 and ntxgr437 for greek environment

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

Posted: Wed Nov 14, 2012 2:38 pm
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