Oemtoansi ERROR ??????

Oemtoansi ERROR ??????

Postby demont frank » Fri Jun 01, 2007 8:52 am

Hello,

Using code page "FR" , i try to convert characters as à , é , ç , è to uppercase

i.e.

# include "fivewin.ch"

i := 233
? STR(i,3) + " : " + CHR(i) + " " + CHR(i-32)+"/"+UPPER(CHR(i))
Result :
233 : é É/é , Upper doesn't convert , É exists ! , but E should be better

i := 130
? OemToAnsi(STR(i,3) + " : " + CHR(i) + " " + CHR(i-32)+"/"+UPPER(CHR(i)))
Result :
130 : é b/E , i like this conversion to E but, In upper() is chr(i) not set to ansi !!!

MsgInfo( OemToAnsi(CHR(130)) , ASC(OemToAnsi(CHR(130))) , UPPER(OemToAnsi(CHR(130))) , UPPER(CHR(130)))

So to convert "é" , we have to do :

UPPER(AnsiToOem("é"))


Frank
demont frank
 
Posts: 167
Joined: Thu Mar 22, 2007 11:24 am

Postby Antonio Linares » Fri Jun 01, 2007 9:45 am

Frank,

OemToAnsi() makes a call to a Windows API built-in function.

You can always implement your own OemToAnsi() function and make it work as you may need
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42100
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Upper()

Postby demont frank » Fri Jun 01, 2007 10:02 am

Antonio,

Maybe it is not oemtoansi , but upper() that must be changed !!

Frank
demont frank
 
Posts: 167
Joined: Thu Mar 22, 2007 11:24 am

Postby Antonio Linares » Fri Jun 01, 2007 10:24 am

Frank,

You can always make a proposal to the Harbour developers mailing list, as Upper() belongs to harbour runtime libraries (RTL), and be sure it will be reviewed
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42100
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Maurilio Viana » Mon Jun 04, 2007 1:01 pm

Frank, AnsiUpper convert accented characters to upper case.
i.e: AnsiUpper("éáç AEI aei") ------> Result: "ÉÁÇ AEI AEI"

(But it don't work with comercial xHarbour. Generate a GPF...)

Or you can create your own OemToAnsi / Upper function. I created my own Upper function (UpperPT_BR) to capitalize brazilian portuguese characters correctly.

Regards,
Maurilio
User avatar
Maurilio Viana
 
Posts: 252
Joined: Tue Oct 25, 2005 2:48 pm
Location: Garça/Garza/Heron City - Brazil


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 87 guests