UPPPER() function doesn't work with Greek Characters

Issues and Discussions related to Harbour

Moderator: Rathinagiri

User avatar
quartz565
Posts: 437
Joined: Mon Oct 01, 2012 12:37 pm
Location: Thessaloniki, Greece
Has thanked: 95 times
Been thanked: 11 times
Contact:

UPPER() function doesn't work with Greek Characters

Post by quartz565 » Mon Nov 12, 2012 10:59 pm

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 2012 - 64
hw: HP Server E5606, 2.13GHz, 8.00 GB - Intel Xeon CPU

User avatar
esgici
Posts: 4310
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Has thanked: 201 times
Been thanked: 71 times
Contact:

Post by esgici » Mon Nov 12, 2012 11:26 pm

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: 437
Joined: Mon Oct 01, 2012 12:37 pm
Location: Thessaloniki, Greece
Has thanked: 95 times
Been thanked: 11 times
Contact:

Post by quartz565 » Tue Nov 13, 2012 12:04 pm

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 2012 - 64
hw: HP Server E5606, 2.13GHz, 8.00 GB - Intel Xeon CPU

User avatar
esgici
Posts: 4310
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Has thanked: 201 times
Been thanked: 71 times
Contact:

Post by esgici » Tue Nov 13, 2012 12:20 pm

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: 4058
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil
Has thanked: 100 times
Been thanked: 176 times

Post by Pablo César » Tue Nov 13, 2012 3:55 pm

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: 4310
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Has thanked: 201 times
Been thanked: 71 times
Contact:

Post by esgici » Tue Nov 13, 2012 3:58 pm

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: 437
Joined: Mon Oct 01, 2012 12:37 pm
Location: Thessaloniki, Greece
Has thanked: 95 times
Been thanked: 11 times
Contact:

Post by quartz565 » Wed Nov 14, 2012 11:43 am

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 2012 - 64
hw: HP Server E5606, 2.13GHz, 8.00 GB - Intel Xeon CPU

User avatar
quartz565
Posts: 437
Joined: Mon Oct 01, 2012 12:37 pm
Location: Thessaloniki, Greece
Has thanked: 95 times
Been thanked: 11 times
Contact:

Post by quartz565 » Wed Nov 14, 2012 11:46 am

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 2012 - 64
hw: HP Server E5606, 2.13GHz, 8.00 GB - Intel Xeon CPU

User avatar
quartz565
Posts: 437
Joined: Mon Oct 01, 2012 12:37 pm
Location: Thessaloniki, Greece
Has thanked: 95 times
Been thanked: 11 times
Contact:

Post by quartz565 » Wed Nov 14, 2012 12:12 pm

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 2012 - 64
hw: HP Server E5606, 2.13GHz, 8.00 GB - Intel Xeon CPU

User avatar
Pablo César
Posts: 4058
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil
Has thanked: 100 times
Been thanked: 176 times

Post by Pablo César » Wed Nov 14, 2012 2:38 pm

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