#include "FiveWin.ch"
/* #translate SET CODEPAGE TO SPANISH => REQUEST HB_CODEPAGE_ESWIN ; hb_setcodepage("ESWIN") */
// #translate SET CODEPAGE TO SPANISH => REQUEST HB_CODEPAGE_ESWIN ; hb_cdpSelect("ESWIN")
REQUEST HB_CODEPAGE_ESWIN
REQUEST HB_LANG_ES
REQUEST HB_CODEPAGE_ES850C
REQUEST HB_CODEPAGE_ESISO
FUNCTION SALAZAR_UTF8()
LOCAL cString, cStr
//hb_setcodepage("ESWIN")
//hb_cdpSelect("ESWIN")
// O:
HB_SETCODEPAGE('ES850C')
HB_LANGSELECT('ES')
HB_SETCODEPAGE( "UTF8" )
cStr :="áéíóú ÁÉÍÓÚ"
cStr := UPPER( TiraAcento( cStr ) )
MEMOWRIT( ".\UTF8.txt", ;
hb_strtoutf8(cStr) +CRLF+ ;
hb_strtoutf8(HB_AnsiToOem(cStr)) +CRLF+ ;
HB_StrToUTF8( cStr,"ESWIN" ) )
RETURN NIL
FUNCTION TiraAcento( cText )
LOCAL ARINICIO, ARFIM, XRETTEXT, ICTEXT, LETRACTEXT
cText := StrTran(cText,"\","/")
cText := StrTran(cText,"Ã","A")
cText := StrTran(cText,"Â","A")
cText := StrTran(cText,"Á","A")
cText := StrTran(cText,"Ä","A")
cText := StrTran(cText,"À","A")
cText := StrTran(cText,"ã","a")
cText := StrTran(cText,"â","a")
cText := StrTran(cText,"á","a")
cText := StrTran(cText,"ä","a")
cText := StrTran(cText,"à","a")
cText := StrTran(cText,"É","E")
cText := StrTran(cText,"Ê","E")
cText := StrTran(cText,"Ë","E")
cText := StrTran(cText,"È","E")
cText := StrTran(cText,"é","e")
cText := StrTran(cText,"ê","e")
cText := StrTran(cText,"ë","e")
cText := StrTran(cText,"è","e")
cText := StrTran(cText,"Í","I")
cText := StrTran(cText,"Î","I")
cText := StrTran(cText,"Ï","I")
cText := StrTran(cText,"Ì","I")
cText := StrTran(cText,"í","i")
cText := StrTran(cText,"î","i")
cText := StrTran(cText,"ï","i")
cText := StrTran(cText,"ì","i")
cText := StrTran(cText,"Ó","O")
cText := StrTran(cText,"Õ","O")
cText := StrTran(cText,"Ô","O")
cText := StrTran(cText,"ó","o")
cText := StrTran(cText,"Ö","O")
cText := StrTran(cText,"Ò","O")
cText := StrTran(cText,"õ","o")
cText := StrTran(cText,"ô","o")
cText := StrTran(cText,"ó","o")
cText := StrTran(cText,"ö","o")
cText := StrTran(cText,"ò","o")
cText := StrTran(cText,"Û","U")
cText := StrTran(cText,"Ú","U")
cText := StrTran(cText,"Ü","U")
cText := StrTran(cText,"Ù","U")
cText := StrTran(cText,"û","u")
cText := StrTran(cText,"ú","u")
cText := StrTran(cText,"ü","u")
cText := StrTran(cText,"ù","u")
cText := StrTran(cText,"Ç","C")
cText := StrTran(cText,"ç","c")
cText := StrTran(cText,"£","E")
cText := StrTran(cText,"&","E")
cText := StrTran(cText,"<",".")
cText := StrTran(cText,">",".")
cText := StrTran(cText,"ª","a")
cText := StrTran(cText,"º","o")
cText := StrTran(cText,"´"," ")
cText := StrTran(cText,"²","2")
cText := StrTran(cText,"³"," ")
cText := StrTran(cText,"¹","1")
arINICIO := 32
arFIM := 126
xRetText := ""
For IcText=1 to len(cText)
LetracText := subs( cText, IcText, 1 )
if asc(LetracText)<arINICIO .or. asc(LetracText)>arFIM
LetracText := " "
end
xRetText += LetracText
next
RETURN(xRetText)