UPPER() and IsAlpha() return not reals values in french
- Badara Thiam
- Posts: 160
- Joined: Tue Oct 18, 2005 10:21 am
- Location: France
- Contact:
UPPER() and IsAlpha() return not reals values in french
Hello, there is a long time ! Everybody works well ?
I submit to you this because it is a big problem for me (and maybe others french users) :
- I cannot use UPPER() function because it not return the good value
with accented characters. I was obliged to create my own function to replace UPPER(), but I cannot use it in the index keys with ADS, because ADS does not re-know this function, which has no same name because I did not find as to replace it in xHarbour.
It seems to me that IsAlpha() is the center of the problem. IsAlpha() with xHarbour return always .F. for accented characters.
Is this solved SINCE fwh 13.7 and xHarbour 1.2.1 ?
I submit to you this because it is a big problem for me (and maybe others french users) :
- I cannot use UPPER() function because it not return the good value
with accented characters. I was obliged to create my own function to replace UPPER(), but I cannot use it in the index keys with ADS, because ADS does not re-know this function, which has no same name because I did not find as to replace it in xHarbour.
It seems to me that IsAlpha() is the center of the problem. IsAlpha() with xHarbour return always .F. for accented characters.
Is this solved SINCE fwh 13.7 and xHarbour 1.2.1 ?
Badara Thiam
http://www.icim.fr
http://www.icim.fr
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Re: UPPER() and IsAlpha() return not reals values in french
Hi Badara, welcome back!
Can you show a little sample of the problem, please?
EMG
Can you show a little sample of the problem, please?
EMG
- Badara Thiam
- Posts: 160
- Joined: Tue Oct 18, 2005 10:21 am
- Location: France
- Contact:
Re: UPPER() and IsAlpha() return not reals values in french
Hi Enrico !
I prepare it to you. It is a little complex because translation ASCII-ANSI.
I retrieve this test function you gave to me and i modify it to try to see more :
I prepare it to you. It is a little complex because translation ASCII-ANSI.
I retrieve this test function you gave to me and i modify it to try to see more :
Code: Select all
****************
FUNCTION FWTEST15()
****************
local i, c, u:={}, l:={}, a[256], s:=""
LOCAL charsASCII :={}, charsANSI :={}
for i:=0 to 255
c:=chr(i)
if i >= 32
aadd(charsASCII,c)
aadd(charsANSI,OemToAnsi(c))
endif
if isalpha(c) .and. ascan(u,c)==0 .and. ascan(l,c)==0
aadd(u,upper(c))
aadd(l,lower(c))
endif
next
asort(charsASCII)
asort(charsANSI)
asort(u)
asort(l)
s += "ASCII Codes 32-255 : "
aeval(charsASCII,{|x|s+=x})
s+=CRLF
s += "ANSI Codes 32-255 : "
aeval(charsANSI,{|x|s+=x})
s+=CRLF
s += "Upper() : "
aeval(u,{|x|s+=x})
s+=CRLF
s += "Lower() : "
aeval(l,{|x|s+=x})
s+=CRLF
memowrit("C:\letters.out", s)
Last edited by Badara Thiam on Sun Jun 03, 2018 3:28 pm, edited 1 time in total.
Badara Thiam
http://www.icim.fr
http://www.icim.fr
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Re: UPPER() and IsAlpha() return not reals values in french
Please try something simpler like:
where x is one character that cannot be converted correctly by UPPER().
EMG
Code: Select all
? UPPER( "x" )
EMG
- Badara Thiam
- Posts: 160
- Joined: Tue Oct 18, 2005 10:21 am
- Location: France
- Contact:
Re: UPPER() and IsAlpha() return not reals values in french
Example : Upper("é"), Upper("è") or Upper("ê") must return "E"
Do you want the complete list of char impacted in french ?
Do you want the complete list of char impacted in french ?
Last edited by Badara Thiam on Sun Jun 03, 2018 3:39 pm, edited 1 time in total.
Badara Thiam
http://www.icim.fr
http://www.icim.fr
- nageswaragunupudi
- Posts: 8017
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact:
Re: UPPER() and IsAlpha() return not reals values in french
1) This has nothing to do with FWH. These functions are from Harbour/xHarbour
2) If you set codepage to French, Upper and IsAlpha() work correctly
2) If you set codepage to French, Upper and IsAlpha() work correctly
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
- Badara Thiam
- Posts: 160
- Joined: Tue Oct 18, 2005 10:21 am
- Location: France
- Contact:
Re: UPPER() and IsAlpha() return not reals values in french
Hi Nageswaragunupudi,
This is in my code :
HB_LangSelect("FR")
HB_SetCodePage("FR")
SET(_SET_LANGUAGE, "FR")
This is in my code :
HB_LangSelect("FR")
HB_SetCodePage("FR")
SET(_SET_LANGUAGE, "FR")
Badara Thiam
http://www.icim.fr
http://www.icim.fr
- nageswaragunupudi
- Posts: 8017
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact:
Re: UPPER() and IsAlpha() return not reals values in french
This is a test with German language
You may use
HB_LangSelect( "FR" )
HB_SetCodePage( "FRWIN" )
Regarding ADS, I understand that we can configure Language (Character Set) on the Server. I do not remember much now.
Code: Select all
HB_LangSelect("DE")
HB_SetCodePage("DEWIN")
c := "öäü"
? c, UPPER( c ), ISALPHA( c )
You may use
HB_LangSelect( "FR" )
HB_SetCodePage( "FRWIN" )
Regarding ADS, I understand that we can configure Language (Character Set) on the Server. I do not remember much now.
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
- Badara Thiam
- Posts: 160
- Joined: Tue Oct 18, 2005 10:21 am
- Location: France
- Contact:
Re: UPPER() and IsAlpha() return not reals values in french
There is no change when i replace "FR" by "FRWIN"..
My databases are in DOS codepage ASCII
My databases are in DOS codepage ASCII
Badara Thiam
http://www.icim.fr
http://www.icim.fr
- nageswaragunupudi
- Posts: 8017
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact:
Re: UPPER() and IsAlpha() return not reals values in french
Just now, I installed French language and keyboard and tested this code:
This is working both with Harbour and xHarbour.
Code: Select all
HB_LangSelect("FR")
HB_SetCodePage("FRWIN")
c := "èàùé"
? c, UPPER( c ), ISALPHA( c )
This is working both with Harbour and xHarbour.
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
- Badara Thiam
- Posts: 160
- Joined: Tue Oct 18, 2005 10:21 am
- Location: France
- Contact:
Re: UPPER() and IsAlpha() return not reals values in french
It is not like Clipper. With Clipper you have "EAUE".
It is a big problem in the indexed lists with alphabetic order... Because "é" is after "z" for example.
Where can i find the list of possible parameters for HB_SetCodePage() please ?
It is a big problem in the indexed lists with alphabetic order... Because "é" is after "z" for example.
Where can i find the list of possible parameters for HB_SetCodePage() please ?
Badara Thiam
http://www.icim.fr
http://www.icim.fr
- Badara Thiam
- Posts: 160
- Joined: Tue Oct 18, 2005 10:21 am
- Location: France
- Contact:
Re: UPPER() and IsAlpha() return not reals values in french
I think that accented characters returned by the UPPER() function of [x]Harbour, is not a good idea..
With that, impossible to have a list in alphabetic order.
With that, impossible to have a list in alphabetic order.
Badara Thiam
http://www.icim.fr
http://www.icim.fr
- nageswaragunupudi
- Posts: 8017
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact:
Re: UPPER() and IsAlpha() return not reals values in french
Clipper is not correct. (x)Harbour is correct.It is not like Clipper. With Clipper you have "EAUE".
Code: Select all
It is a big problem in the indexed lists with alphabetic order... Because "é" is after "z" for example.
Anyway please try USING the DBF with CODEPAGE clause.
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
- Badara Thiam
- Posts: 160
- Joined: Tue Oct 18, 2005 10:21 am
- Location: France
- Contact:
Re: UPPER() and IsAlpha() return not reals values in french
UPPER() with Clipper help also to eliminate accent. [x]Harbour do not make this. This is a important difference. With Clipper we have correct alphabetic lists, with [x]Harbour no. Clipper was more correct. [x]Harbour developpers must make Upper() working like Clipper, and create a new function to return Upper case with accents. The new function could be named UpperReal() for example... But UPPER() is the only one accepted in ADS keys to do what Clipper Upper() do very well. Not [x]Harbour.
Badara Thiam
http://www.icim.fr
http://www.icim.fr
- Badara Thiam
- Posts: 160
- Joined: Tue Oct 18, 2005 10:21 am
- Location: France
- Contact:
Re: UPPER() and IsAlpha() return not reals values in french
I have posted a message in xHarbour forum here : https://groups.google.com/forum/#!topic ... ZDXRiQpoP8
Badara Thiam
http://www.icim.fr
http://www.icim.fr