Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Upper() does not upper german umlauts

18 views
Skip to first unread message

Michael Hagl

unread,
Feb 23, 2009, 3:49:25 PM2/23/09
to
Hi,

new problem !!

Upper() does not uppercase german umlauts

ie.
ä (Chr(132)) --> Ä (Chr(142))
ö (Chr(148)) --> Ö (Chr(153))

I have tried some Codepagesettings, but Upper() doesn't matter

Also GET picture "!!!!!!!!" does not uppercase the Umlauts


Does HB_SetCodepage() influence the order of a dbf-index (FPTCDX)
Ä (Chr(142)) should be sorted behind A and not behind "Z"


Michael Hagl


dlzc

unread,
Feb 23, 2009, 5:06:20 PM2/23/09
to
Dear Michael Hagl:

On Feb 23, 1:49 pm, "Michael Hagl" <hag...@hagl.de> wrote:
...


> new problem !!
>
> Upper() does not uppercase german umlauts
>
> ie.
> ä (Chr(132)) --> Ä (Chr(142))
> ö (Chr(148)) --> Ö (Chr(153))
>
> I have tried some Codepagesettings, but Upper()
> doesn't matter

Did you REQUEST them before the first line of executable code, like
the documentation shows?

> Also GET picture "!!!!!!!!" does not uppercase the
> Umlauts
>
> Does HB_SetCodepage() influence the order of a
> dbf-index  (FPTCDX) Ä (Chr(142)) should be sorted
> behind A and not behind "Z"

Seems all related, as you surmise.

David A. Smith

Michael Hagl

unread,
Feb 24, 2009, 2:43:32 AM2/24/09
to
Hi David,

I think the function Upper() makes complete nonsense !!


Function Start()
? "Codepage: "+HB_SetCodePage()
? "Upper(Chr(132)) --> "+Upper(Chr(132))+" Asc(Upper(Chr(132))) -->
"+Str(Asc(Upper(Chr(132))))
? "Upper(Chr(142)) --> "+Upper(Chr(142))+" Asc(Upper(Chr(142))) -->
"+Str(Asc(Upper(Chr(142))))
wait
Return Nil

===>

Codepage: EN
Upper(Chr(132)) --> D Asc(Upper(Chr(132))) --> 68
Upper(Chr(142)) --> Asc(Upper(Chr(142))) --> 0
Press any key to continue...


Do I have an old version of xHarbour Builder ???
That cannot be true !!
I think every developer needs the upper function.
Is this a problem of xHarbour Builder, or xHarbour, or ???

I know, xharbour is a open source project. Can anyone tell me, who is the
right contact for such a problem ?

"dlzc" <dl...@cox.net> schrieb im Newsbeitrag
news:061eed15-d9c4-4689...@13g2000yql.googlegroups.com...

Thierry

unread,
Feb 24, 2009, 3:59:03 AM2/24/09
to
Hallo Michael,

my code starts with:

REQUEST HB_LANG_DE
REQUEST HB_CODEPAGE_DE850

HB_LangSelect ("DE")
HB_SetCodePage ("DE850")

Sorting and "upper case"-gets work fine with "äöü". :)

Thierry

PS: Liebe Grüße aus dem Schwarzwald :)


Michael Hagl schrieb:

Michael Hagl

unread,
Feb 24, 2009, 4:36:46 AM2/24/09
to
Hi Thierry

in this code Upper() does not work.


Michael
Bayern, Freising


*********************************************************************************
REQUEST HB_LANG_DE
REQUEST HB_CODEPAGE_DE850

Function Start()

HB_LangSelect ("DE")
HB_SetCodePage ("DE850")

? "Codepage: "+HB_SetCodePage()

? "Upper(Chr(132)) --> "+Upper(Chr(132))+" Asc(Upper(Chr(132))) -->
"+Str(Asc(Upper(Chr(132))))
? "Upper(Chr(142)) --> "+Upper(Chr(142))+" Asc(Upper(Chr(142))) -->
"+Str(Asc(Upper(Chr(142))))

wait
Return Nil

==>

Codepage: DE850


Upper(Chr(132)) --> D Asc(Upper(Chr(132))) --> 68
Upper(Chr(142)) --> Asc(Upper(Chr(142))) --> 0
Press any key to continue...

********************************************************************************

Have I to include some *.CH
Working with xBuild Wizard 4.5 Sept 30 2008
xHarbour-C-Compiler: Pelles ISO C Compiler 2.70
xHarbour-PCode : PCode Version: 9
xHarbour-BuildInfo : xHarbour build 1.1.0 Intl. (SimpLex) (Rev. 6220)
xHarbour-BuildDate : Sep 30 2008 14:36:42

12.05.2008 00:00 115,518 ACE32.lib
30.09.2008 14:53 109,800 ActiveX.lib
30.09.2008 14:53 270,652 ADS.lib
12.05.2008 00:00 30,694 BGD.lib
30.09.2008 14:51 294,758 CDX.lib
30.09.2008 14:52 255,466 CDXmt.lib
30.09.2008 14:53 49,798 Comm.lib
31.10.2007 06:15 785,566 CT3.lib
30.09.2008 14:53 64,732 CT3Comm.lib
30.09.2008 14:51 1,323,466 DBF.lib
30.09.2008 14:52 1,327,984 DBFmt.lib
30.09.2008 14:53 56,188 DbgServe.lib
30.09.2008 14:52 6,322 DllMain.lib
30.09.2008 14:52 6,322 DllMain.lib.alt
04.12.2008 08:38 10,940 dmain.lib
07.02.2006 13:07 59,900 fbclient_ms.lib
30.09.2008 14:53 75,416 FreeImage-xHB.lib
12.05.2008 00:00 53,854 FreeImage.lib
12.05.2008 00:00 4,312 FTS32.lib
30.09.2008 14:53 235,174 GD.lib
30.09.2008 14:53 69,530 LibMisc.lib
02.01.2006 01:38 34,900 libmysql.lib
07.02.2006 13:07 25,002 libpq.lib
30.09.2008 14:53 683,422 mySQL.lib
30.09.2008 14:53 684,100 mySQLmt.lib
30.09.2008 14:53 935,348 Nanfor.lib
30.09.2008 14:52 23,348 NoRDD.lib
30.09.2008 14:51 254,654 NTX.lib
30.09.2008 14:52 254,664 NTXmt.lib
26.04.2005 00:54 145,646 oci.lib
30.09.2008 14:53 69,808 ODBC.lib
31.10.2007 06:15 164,704 Ole.lib
30.09.2008 14:53 226,652 OleServer.lib
30.09.2008 14:51 415,618 Optg.lib
30.09.2008 14:52 401,854 OPTGmt.lib
30.09.2008 14:53 310,954 RMDBFCDX.lib
12.05.2008 00:00 40,682 SDE61.lib
30.09.2008 14:53 118,450 Six.lib
30.09.2008 14:51 296,046 SixCDX.lib
30.09.2008 14:53 1,018,088 SQL.lib
30.09.2008 14:53 1,015,522 SQLmt.lib
30.09.2008 14:53 113,678 TProject.lib
29.08.2008 11:03 3,307,842 VXH.lib
26.08.2008 13:45 198,520 VXHd.lib
30.09.2008 14:53 421,826 WinApi.lib
30.09.2008 14:53 532,882 WVG.lib
30.09.2008 14:53 91,608 WVT.lib
31.10.2007 06:14 386,070 WVTG.lib
31.10.2007 06:14 558,618 WVW.lib
30.09.2008 14:53 376,394 XBScript.lib
30.09.2008 14:53 2,962 XDO.lib
30.09.2008 14:53 292,830 xEditW.lib
30.09.2008 14:51 8,603,792 xHB.lib
30.09.2008 14:53 23,298 xHBCOMM.lib
30.09.2008 14:53 8,902 xHBCommDll.lib
30.09.2008 14:51 739,196 xHBdDll.lib
30.09.2008 14:51 735,116 xHBDll.lib
30.09.2008 14:52 758,442 xHBdmtDll.lib
30.09.2008 14:52 8,881,850 xHBmt.lib
30.09.2008 14:52 754,298 xHBmtDll.lib
30.09.2008 14:53 54,282 xHBZIP.lib
30.09.2008 14:53 353,226 xHBZipDll.lib


"Thierry" <thi...@tmblues.com> schrieb im Newsbeitrag
news:go0csp$8g9$1...@news.motzarella.org...

Thierry

unread,
Feb 24, 2009, 5:25:39 AM2/24/09
to
Ok, same problems here:

? Asc(Upper("A")) -> 65
? Asc ("A") -> 65
? Asc(Upper("Ä")) -> 0
? Asc ("Ä") -> 142
? Asc(Upper("ä")) -> 68
? Asc ("ä") -> 132
? Asc(Upper("Ö")) -> 83
? Asc ("Ö") -> 153
? Asc(Upper("ö")) -> 72
? Asc ("ö") -> 148
? Asc(Upper("Ü")) -> 80
? Asc ("Ü") -> 154
? Asc(Upper("ü")) -> 43
? Asc ("ü") -> 129
? Asc(Upper("ß")) -> 115
? Asc ("ß") -> 225

Shouldn't give

? Asc(Upper("Ä")) -> 0
? Asc ("Ä") -> 142
? Asc(Upper("ä")) -> 68

the same results?

Thierry


Michael Hagl schrieb:

Michael Hagl

unread,
Feb 24, 2009, 5:36:31 AM2/24/09
to
Hi Thierry,

I get the same results.
Lower() seems to be ok.

I'm glad, that I'm not alone with the problem.

I thought, I'll be stupid

Michael


"Thierry" <thi...@tmblues.com> schrieb im Newsbeitrag

news:go0hv3$is0$1...@news.motzarella.org...

N:dlzc D:aol T:com (dlzc)

unread,
Feb 24, 2009, 8:13:49 AM2/24/09
to
Dear Michael Hagl:

"Michael Hagl" <hag...@hagl.de> wrote in message
news:go0ijk$98g$1...@online.de...


>
> I get the same results.
> Lower() seems to be ok.
>
> I'm glad, that I'm not alone with the problem.
>
> I thought, I'll be stupid

No, I just thought it would be easy. Will you make a bug report?
http://www.xharbour.com/support/bugreporter/index.asp?page=home

Give them the sample that shows the error. And include the
REQUEST stuff.

David A. Smith


Michael Hagl

unread,
Feb 24, 2009, 12:26:32 PM2/24/09
to
Hi David

thank you, you makes a realy good job here.

I have made a bug report.

But how long will take a solution for this bug ? And will come a update or
patch or something ?
I can't wait until the next release.
But I think this is a question to Ron or Patrick.

I will write my own MyUpper() function and replace all Upper() with
MyUpper() (about 600 times). But my software includes a formdesigner, where
customers can build their own reports (and they also knows and use Upper())

Can the Upper() function itself be replaced be my own function ?

Michael


"N:dlzc D:aol T:com (dlzc)" <dl...@cox.net> schrieb im Newsbeitrag
news:4oSol.24577$rb1....@newsfe02.iad...

dlzc

unread,
Feb 24, 2009, 2:05:40 PM2/24/09
to
Dear Michael Hagl:

On Feb 24, 10:26 am, "Michael Hagl" <hag...@hagl.de> wrote:
>
> thank you, you makes a realy good job here.

You are welcome. One of the things that fails an open source project
is a dull thud when "problems" are encountered. The reason I chose
xHarbour is because it is "alive", where other choices for handling
xbase were essentially dead. So I am "paying it forward".

> I have made a bug report.
>
> But how long will take a solution for this bug ?

I have seen them researched and solved in hours.

> And will come a update or patch or something ?

Probably CVS, which you'd download. Not sure if we made the next
release of the .org version. .com update sometime soon too. Not sure
how one dovetails CVS implementation into xBuilder. But my needs are
very small.

> I can't wait until the next release.
> But I think this is a question to Ron or Patrick.
>
> I will write my own MyUpper() function and replace
> all  Upper() with MyUpper() (about 600 times).

Don't.

> But my software includes a formdesigner, where
> customers can build their own reports (and they
> also knows and use Upper())
>
> Can the Upper() function itself be replaced be my
> own function ?

Yes. In each source file, at the top, you simply define "upper" to
"MyUpper". That takes care of your source code (until a fix is
obtained). For the macro expression... I can't help you much there.
Maybe you won't have to wait long enough for that to be an issue. Or
maybe someone else has a better fix...

David A. Smith

N:dlzc D:aol T:com (dlzc)

unread,
Feb 24, 2009, 11:38:31 PM2/24/09
to
Dear Michael Hagl:

"Michael Hagl" <hag...@hagl.de> wrote in message

news:go1akc$cr$1...@online.de...
...


> I will write my own MyUpper() function and replace
> all Upper() with MyUpper()

*I* think you should name it kapitalisieren()

> (about 600 times). But my software includes a
> formdesigner, where customers can build their own
> reports (and they also knows and use Upper())

English or German customers, or both?

David A. Smith


Patrick Mast

unread,
Feb 25, 2009, 3:40:03 AM2/25/09
to
Hello Thierry,

> ? Asc(Upper("Ä")) -> 0
> ? Asc ("Ä") -> 142
> ? Asc(Upper("ä")) -> 68

Latest CVS gives:

? Asc(Upper("Ä")) -> 73
? Asc ("Ä") -> 195
? Asc(Upper("ä")) -> 73

Is this the result you expected?

--
Sincerely,

Patrick Mast,
www.xHarbour.com

Patrick Mast

unread,
Feb 25, 2009, 3:41:41 AM2/25/09
to
Hello Michael,

Latest xHarbour Builder BETA (Build from latest xHarbour.org's CVS)
gives this result:

Codepage: DE850
Upper(Chr(132)) --> É Asc(Upper(Chr(132))) --> 144
Upper(Chr(142)) --> H Asc(Upper(Chr(142))) --> 72

Is this the result you expected?

Patrick

Michael Hagl

unread,
Feb 25, 2009, 4:18:44 AM2/25/09
to
Patrick

> Upper(Chr(132)) --> É Asc(Upper(Chr(132))) --> 144

This is wrong, the whole german spoken countries expect here 142

> Upper(Chr(142)) --> H Asc(Upper(Chr(142))) --> 72

Please think about this. It's complete nonsense. I mean that
Lower(Upper(Chr(142))) MUST result Chr(142) !!

Try this witch Codepage EN. Upper() also do not work correct.


Michael Hagl


"Patrick Mast" <Patrick.Rem...@xHarbour.com> schrieb im Newsbeitrag
news:go3085$r0h$1...@news.motzarella.org...

Michael Hagl

unread,
Feb 25, 2009, 4:45:11 AM2/25/09
to
David,

> *I* think you should name it kapitalisieren()

ohh, this is a terrible word and means capitalise. It's one of the "Unwort
des Jahres" (most stupid word of the year, picked every year by a jury)

I think I name it xUpper() or _Upper() or somewhere or Großschrift()

Of course I will use preprocessor to raplace Upper(). I haven't thougt to
that in my desaster.

I am using xHarbour Builder. Here the libs are other than CVS. I think that
can not be mixed. Soe I have to wait for xHarbour Inc.

I have only german spoken Users (and one in poland)
In the formdesigner I think I will replace Upper(), after reading a form
line before it goes to the macro compiler.

I'm sorry for my bad english and everyone understand, what I mean.

Michael


"N:dlzc D:aol T:com (dlzc)" <dl...@cox.net> schrieb im Newsbeitrag

news:cX3pl.51229$xK6....@newsfe12.iad...

Patrick Mast

unread,
Feb 25, 2009, 5:40:46 AM2/25/09
to
Michael,

> I am using xHarbour Builder. Here the libs are other than CVS. I think that
> can not be mixed. Soe I have to wait for xHarbour Inc.

Correct, you can not mix them.

Patrick Mast

unread,
Feb 25, 2009, 5:48:36 AM2/25/09
to
Hello Michael,

>> Upper(Chr(142)) --> H Asc(Upper(Chr(142))) --> 72
>
> Please think about this. It's complete nonsense. I mean that
> Lower(Upper(Chr(142))) MUST result Chr(142) !!

There is no cost in being polite.

Patrick

moda...@yahoo.com.br

unread,
Feb 25, 2009, 6:00:44 AM2/25/09
to
Patrick,

The upper() function has different results under Borland and Pelles C.
It seems a Pelles bug.
Can you confirm ?

regards,
Eduardo

On 25 fev, 07:48, Patrick Mast <Patrick.RemoveThis.M...@xHarbour.com>
wrote:

marchuet

unread,
Feb 25, 2009, 6:10:09 AM2/25/09
to
Codepage EN don't translate this chars, it's clipper compatible
Please select correct codepage

Best regards,
Miguel Angel Marchuet


On 24 feb, 08:43, "Michael Hagl" <hag...@hagl.de> wrote:
> Hi David,
>
> I think the function Upper() makes complete nonsense !!
>
> Function Start()
> ? "Codepage: "+HB_SetCodePage()
> ? "Upper(Chr(132)) --> "+Upper(Chr(132))+" Asc(Upper(Chr(132))) -->
> "+Str(Asc(Upper(Chr(132))))
> ? "Upper(Chr(142)) --> "+Upper(Chr(142))+" Asc(Upper(Chr(142))) -->
> "+Str(Asc(Upper(Chr(142))))
> wait
> Return Nil
>
> ===>
>
> Codepage: EN
> Upper(Chr(132)) --> D Asc(Upper(Chr(132))) -->         68
> Upper(Chr(142)) -->   Asc(Upper(Chr(142))) -->          0
> Press any key to continue...
>
> Do I have an old version of xHarbour Builder ???
> That cannot be true !!
> I think every developer needs the upper function.
> Is this a problem of xHarbour Builder, or xHarbour, or ???
>
> I know, xharbour is a open source project. Can anyone tell me, who is the
> right contact for such a problem ?
>

> "dlzc" <dl...@cox.net> schrieb im Newsbeitragnews:061eed15-d9c4-4689...@13g2000yql.googlegroups.com...

Michael Hagl

unread,
Feb 25, 2009, 7:17:44 AM2/25/09
to
Patrick

I am sorry.
It is not simple for me to find the right words, because my english is not
very good, but I'l trying my best.

I mean the returned value of Upper() is nonsense.

Should not Lower(Upper("Somewhat over ascii 128 äöü")) returned the
delivered value ??
IMHO is this a very big bug in Upper() function.
At this moment, I think that nobody is understanding my problem.
If this bug is no problem, would please someone explain to me !

Michael Hagl


"Patrick Mast" <Patrick.Rem...@xHarbour.com> schrieb im Newsbeitrag

news:go37m4$r1$1...@news.motzarella.org...

Michael Hagl

unread,
Feb 25, 2009, 7:23:38 AM2/25/09
to
no, no,

in my sample below, it does not matter, which codepage I use, the result is
always the same

Maybe it's realy a bug in Pelles C or a bug in commercial product xHarbour
Builder Professional

Michael


"marchuet" <miguelm...@hotmail.com> schrieb im Newsbeitrag
news:f41ffbe2-c0e2-48dc...@v15g2000yqn.googlegroups.com...

moda...@yahoo.com.br

unread,
Feb 25, 2009, 8:42:57 AM2/25/09
to
I have this problem under Pelles C

c := chr(142)
? upper( chr(142) )
? upper( c )

Eduardo

On 25 fev, 09:23, "Michael Hagl" <hag...@hagl.de> wrote:
> no, no,
>
> in my sample below, it does not matter, which codepage I use, the result is
> always the same
>
> Maybe it's realy a bug in Pelles C or a bug in commercial product xHarbour
> Builder Professional
>
> Michael
>

> "marchuet" <miguelmarch...@hotmail.com> schrieb im Newsbeitragnews:f41ffbe2-c0e2-48dc...@v15g2000yqn.googlegroups.com...

Michael Hagl

unread,
Feb 25, 2009, 10:32:09 AM2/25/09
to
aha,

c := Chr(142)
? c --> Ä
? Upper(Chr(142)) --> nothing
? Upper(c) --> Ä
? Upper("Ä") --> nothing
? Chr(142)==c --> .t.
? "Ä"==c --> .t.

The macrocompiler does the following:

c := Chr(142)

? &("Upper(Chr(142))") --> s
? &("Upper('Ä')") --> s
? &("Upper(c)") --> Ä
? &("Chr(142)") --> Ä

?????????
some compiler optimization ?

very strangely

Michael


<moda...@yahoo.com.br> schrieb im Newsbeitrag
news:62285c80-98d7-4ea5...@s36g2000vbp.googlegroups.com...

N:dlzc D:aol T:com (dlzc)

unread,
Feb 25, 2009, 7:28:31 PM2/25/09
to
Dear Michael Hagl:

"Michael Hagl" <hag...@hagl.de> wrote in message

news:go3ct8$opm$1...@online.de...


> I mean the returned value of Upper() is nonsense.
>

> Should not Lower(Upper("Somewhat over ascii 128 dv|"))


> returned the delivered value ??
> IMHO is this a very big bug in Upper() function.
> At this moment, I think that nobody is understanding my
> problem. If this bug is no problem, would please someone
> explain to me !

"modalsist" indicates that Pelles C has the problem, and other
compilers don't.

David A. Smith


Ron Pinkas

unread,
Feb 25, 2009, 10:09:50 PM2/25/09
to
The bug was in xHarbour compile time optimization, and it has been fixed.

"N:dlzc D:aol T:com (dlzc)" <dl...@cox.net> wrote in message
news:Kmlpl.26005$EO2....@newsfe04.iad...

Stefan Haupt

unread,
Feb 26, 2009, 4:05:54 AM2/26/09
to
Michael,

I am not sure if I do not miss somesting in this thread, but
some statements I do not understand.

I my opinion upper() should give us these results:

c := "ä"
Upper (c) -> Ä
Upper ("Ä") -> Ä


n := Asc("ä")
Upper (Chr(n)) -> Ä
n := Asc("Ä")
Upper (Chr(n)) -> Ä

Asc ("ä") gives different results depending on the character
set we use, Oem-characters or Ansi-characters, you must not
mix them !

Stefan


moda...@yahoo.com.br

unread,
Feb 26, 2009, 8:19:27 AM2/26/09
to
Ron,

Under codepage the results are different in both Pelles and Borland
C.

----
REQUEST HB_CODEPAGE_PT850

PROC MAIN

local c := chr(142)+chr(132)

? upper( c )
? upper( chr(142)+chr(132) )

HB_SETCODEPAGE("PT850")

? upper( c )
? upper( chr(142)+chr(132) )


----

regards,
Eduardo

On 26 fev, 00:09, "Ron Pinkas" <RonPinkas_remove_th...@xHarbour.com>
wrote:

Ron Pinkas

unread,
Feb 26, 2009, 8:23:45 AM2/26/09
to
Eduardo,

We are aware that compile time optimization does not support codepages.

Ron

<moda...@yahoo.com.br> wrote in message
news:f7554468-0ad2-493a...@r29g2000vbp.googlegroups.com...

moda...@yahoo.com.br

unread,
Feb 26, 2009, 8:54:00 AM2/26/09
to
Ron,

If I comment the lines (1728 up to 1750) of include\hbexprb.c I get
the expected result on upper() with codepage.

regards,
Eduardo

On 26 fev, 10:23, "Ron Pinkas" <RonPinkas_remove_th...@xHarbour.com>
wrote:

0 new messages