Hello, Mr. Rao,
If I do the test you proposed with FWH 23.07 and with FWH 23.10, I get in both cases an alert with these 4 results:
EN
cp437
1252
850
function convertXML2( cVData, aufruf )
local I := 0
local cTemp := ""
*----------------------------------------------------------
if VALType(aufruf) = "U"
else
cVData := STRTRAN( ALLTRIM(cVData), ";", "," )
endif
/*
cVData := STRTRAN(cVData, "+ae+" , "ä" )
cVData := STRTRAN(cVData, "+ue+" , "ü" )
cVData := STRTRAN(cVData, "+oe+" , "ö" )
cVData := STRTRAN(cVData, "+Ae+" , "Ä" )
cVData := STRTRAN(cVData, "+Oe+" , "Ö" )
cVData := STRTRAN(cVData, "+Ue+" , "Ü" )
cVData := STRTRAN(cVData, "+ss+" , "ß" )
*/
IF ASC(substr(cVData,i,1)) = 10
cVData := STRTRAN( cVData, chr(10 ), " " )
endif
IF ASC(substr(cVData,i,1)) = 13
cVData := STRTRAN(cVData, chr( 13)," ")
endif
FOR I := 1 TO len(cVData)
if ASC(substr(cVData,i,1)) > 128
if ASC(substr(cVData,i,1)) = 195
elseif ASC(substr(cVData,i,1)) < 30
fwlog "<30", ASC( substr(cVData,i,1) )
else
fwlog ">195", substr( cVData, i, 1 ), ASC( substr( cVData, i, 1 ) )
if ASC( substr( cVData, i, 1 ) ) = 128 ; cTemp += "€"
elseif ASC( substr( cVData, i, 1 ) ) = 129 ; cTemp += "Â"
elseif ASC( substr( cVData, i, 1 ) ) = 130 ; cTemp += "‚"
elseif ASC( substr( cVData, i, 1 ) ) = 131 ; cTemp += "Æ’"
elseif ASC( substr( cVData, i, 1 ) ) = 132 ; cTemp += "„"
elseif ASC( substr( cVData, i, 1 ) ) = 133 ; cTemp += "…"
elseif ASC( substr( cVData, i, 1 ) ) = 134 ; cTemp += "â€"
elseif ASC( substr( cVData, i, 1 ) ) = 135 ; cTemp += "‡"
elseif ASC( substr( cVData, i, 1 ) ) = 136 ; cTemp += "ˆ"
elseif ASC( substr( cVData, i, 1 ) ) = 137 ; cTemp += "‰"
elseif ASC( substr( cVData, i, 1 ) ) = 138 ; cTemp += "Å"
elseif ASC( substr( cVData, i, 1 ) ) = 139 ; cTemp += "‹"
elseif ASC( substr( cVData, i, 1 ) ) = 140 ; cTemp += "Å’"
elseif ASC( substr( cVData, i, 1 ) ) = 141 ; cTemp += "Â"
elseif ASC( substr( cVData, i, 1 ) ) = 142 ; cTemp += "Ž"
elseif ASC( substr( cVData, i, 1 ) ) = 143 ; cTemp += "Â"
elseif ASC( substr( cVData, i, 1 ) ) = 144 ; cTemp += "Â"
elseif ASC( substr( cVData, i, 1 ) ) = 145 ; cTemp += "‘"
elseif ASC( substr( cVData, i, 1 ) ) = 146 ; cTemp += "’"
elseif ASC( substr( cVData, i, 1 ) ) = 147 ; cTemp += "“"
elseif ASC( substr( cVData, i, 1 ) ) = 148 ; cTemp += "â€"
elseif ASC( substr( cVData, i, 1 ) ) = 149 ; cTemp += "•"
elseif ASC( substr( cVData, i, 1 ) ) = 150 ; cTemp += "–"
elseif ASC( substr( cVData, i, 1 ) ) = 151 ; cTemp += "—"
elseif ASC( substr( cVData, i, 1 ) ) = 152 ; cTemp += "˜"
elseif ASC( substr( cVData, i, 1 ) ) = 153 ; cTemp += "â„¢"
elseif ASC( substr( cVData, i, 1 ) ) = 154 ; cTemp += "Å¡"
elseif ASC( substr( cVData, i, 1 ) ) = 155 ; cTemp += "›"
elseif ASC( substr( cVData, i, 1 ) ) = 156 ; cTemp += "Å“"
elseif ASC( substr( cVData, i, 1 ) ) = 157 ; cTemp += "Â"
elseif ASC( substr( cVData, i, 1 ) ) = 158 ; cTemp += "ž"
elseif ASC( substr( cVData, i, 1 ) ) = 159 ; cTemp += "Ÿ"
elseif ASC( substr( cVData, i, 1 ) ) = 160 ; cTemp += ""
elseif ASC( substr( cVData, i, 1 ) ) = 161 ; cTemp += "¡"
elseif ASC( substr( cVData, i, 1 ) ) = 162 ; cTemp += "¢"
elseif ASC( substr( cVData, i, 1 ) ) = 163 ; cTemp += "£"
elseif ASC( substr( cVData, i, 1 ) ) = 164 ; cTemp += "¤"
elseif ASC( substr( cVData, i, 1 ) ) = 165 ; cTemp += "Â¥"
elseif ASC( substr( cVData, i, 1 ) ) = 166 ; cTemp += "¦"
elseif ASC( substr( cVData, i, 1 ) ) = 167 ; cTemp += "§"
elseif ASC( substr( cVData, i, 1 ) ) = 168 ; cTemp += "¨"
elseif ASC( substr( cVData, i, 1 ) ) = 169 ; cTemp += "©"
elseif ASC( substr( cVData, i, 1 ) ) = 170 ; cTemp += "ª"
elseif ASC( substr( cVData, i, 1 ) ) = 171 ; cTemp += "«"
elseif ASC( substr( cVData, i, 1 ) ) = 172 ; cTemp += "¬"
elseif ASC( substr( cVData, i, 1 ) ) = 173 ; cTemp += "¬"
elseif ASC( substr( cVData, i, 1 ) ) = 174 ; cTemp += "®"
elseif ASC( substr( cVData, i, 1 ) ) = 175 ; cTemp += "¯"
elseif ASC( substr( cVData, i, 1 ) ) = 176 ; cTemp += "°"
elseif ASC( substr( cVData, i, 1 ) ) = 177 ; cTemp += "±"
elseif ASC( substr( cVData, i, 1 ) ) = 178 ; cTemp += "²"
elseif ASC( substr( cVData, i, 1 ) ) = 179 ; cTemp += "³"
elseif ASC( substr( cVData, i, 1 ) ) = 180 ; cTemp += "´"
elseif ASC( substr( cVData, i, 1 ) ) = 181 ; cTemp += "µ"
elseif ASC( substr( cVData, i, 1 ) ) = 182 ; cTemp += "¶"
elseif ASC( substr( cVData, i, 1 ) ) = 183 ; cTemp += "·"
elseif ASC( substr( cVData, i, 1 ) ) = 184 ; cTemp += "¸"
elseif ASC( substr( cVData, i, 1 ) ) = 185 ; cTemp += "¹"
elseif ASC( substr( cVData, i, 1 ) ) = 186 ; cTemp += "º"
elseif ASC( substr( cVData, i, 1 ) ) = 187 ; cTemp += "»"
elseif ASC( substr( cVData, i, 1 ) ) = 188 ; cTemp += "¼"
elseif ASC( substr( cVData, i, 1 ) ) = 189 ; cTemp += "½"
elseif ASC( substr( cVData, i, 1 ) ) = 190 ; cTemp += "¾"
elseif ASC( substr( cVData, i, 1 ) ) = 191 ; cTemp += "¿"
elseif ASC( substr( cVData, i, 1 ) ) = 192 ; cTemp += "À"
elseif ASC( substr( cVData, i, 1 ) ) = 193 ; cTemp += "Ã"
elseif ASC( substr( cVData, i, 1 ) ) = 194 ; cTemp += "Â"
elseif ASC( substr( cVData, i, 1 ) ) = 195 ; cTemp += "Ã"
elseif ASC( substr( cVData, i, 1 ) ) = 196 ; cTemp += "Ä"
elseif ASC( substr( cVData, i, 1 ) ) = 197 ; cTemp += "Ã…"
elseif ASC( substr( cVData, i, 1 ) ) = 198 ; cTemp += "Æ"
elseif ASC( substr( cVData, i, 1 ) ) = 199 ; cTemp += "Ç"
elseif ASC( substr( cVData, i, 1 ) ) = 200 ; cTemp += "È"
elseif ASC( substr( cVData, i, 1 ) ) = 201 ; cTemp += "€"
elseif ASC( substr( cVData, i, 1 ) ) = 202 ; cTemp += "Ê"
elseif ASC( substr( cVData, i, 1 ) ) = 203 ; cTemp += "Ë"
elseif ASC( substr( cVData, i, 1 ) ) = 204 ; cTemp += "Ì"
elseif ASC( substr( cVData, i, 1 ) ) = 205 ; cTemp += "Ã"
elseif ASC( substr( cVData, i, 1 ) ) = 206 ; cTemp += "ÃŽ"
elseif ASC( substr( cVData, i, 1 ) ) = 207 ; cTemp += "Ã"
elseif ASC( substr( cVData, i, 1 ) ) = 208 ; cTemp += "Ã"
elseif ASC( substr( cVData, i, 1 ) ) = 209 ; cTemp += "Ñ"
elseif ASC( substr( cVData, i, 1 ) ) = 210 ; cTemp += "Ã’"
elseif ASC( substr( cVData, i, 1 ) ) = 211 ; cTemp += "Ó"
elseif ASC( substr( cVData, i, 1 ) ) = 212 ; cTemp += "Ô"
elseif ASC( substr( cVData, i, 1 ) ) = 213 ; cTemp += "Õ"
elseif ASC( substr( cVData, i, 1 ) ) = 214 ; cTemp += "Ö"
elseif ASC( substr( cVData, i, 1 ) ) = 215 ; cTemp += "×"
elseif ASC( substr( cVData, i, 1 ) ) = 216 ; cTemp += "Ø"
elseif ASC( substr( cVData, i, 1 ) ) = 217 ; cTemp += "Ù"
elseif ASC( substr( cVData, i, 1 ) ) = 218 ; cTemp += "Ú"
elseif ASC( substr( cVData, i, 1 ) ) = 219 ; cTemp += "Û"
elseif ASC( substr( cVData, i, 1 ) ) = 220 ; cTemp += "Ü"
elseif ASC( substr( cVData, i, 1 ) ) = 221 ; cTemp += "Ã"
elseif ASC( substr( cVData, i, 1 ) ) = 222 ; cTemp += "Þ"
elseif ASC( substr( cVData, i, 1 ) ) = 223 ; cTemp += "ß"
elseif ASC( substr( cVData, i, 1 ) ) = 224 ; cTemp += "Ã"
elseif ASC( substr( cVData, i, 1 ) ) = 225 ; cTemp += "á"
elseif ASC( substr( cVData, i, 1 ) ) = 226 ; cTemp += "â"
elseif ASC( substr( cVData, i, 1 ) ) = 227 ; cTemp += "ã"
elseif ASC( substr( cVData, i, 1 ) ) = 228 ; cTemp += "ä"
elseif ASC( substr( cVData, i, 1 ) ) = 229 ; cTemp += "Ã¥"
elseif ASC( substr( cVData, i, 1 ) ) = 230 ; cTemp += "æ"
elseif ASC( substr( cVData, i, 1 ) ) = 231 ; cTemp += "ç"
elseif ASC( substr( cVData, i, 1 ) ) = 232 ; cTemp += "è"
elseif ASC( substr( cVData, i, 1 ) ) = 233 ; cTemp += "é"
elseif ASC( substr( cVData, i, 1 ) ) = 234 ; cTemp += "ê"
elseif ASC( substr( cVData, i, 1 ) ) = 235 ; cTemp += "ë"
elseif ASC( substr( cVData, i, 1 ) ) = 236 ; cTemp += "ì"
elseif ASC( substr( cVData, i, 1 ) ) = 237 ; cTemp += "ì"
elseif ASC( substr( cVData, i, 1 ) ) = 238 ; cTemp += "î"
elseif ASC( substr( cVData, i, 1 ) ) = 239 ; cTemp += "ï"
elseif ASC( substr( cVData, i, 1 ) ) = 240 ; cTemp += "ð"
elseif ASC( substr( cVData, i, 1 ) ) = 241 ; cTemp += "ñ"
elseif ASC( substr( cVData, i, 1 ) ) = 242 ; cTemp += "ò"
elseif ASC( substr( cVData, i, 1 ) ) = 243 ; cTemp += "ó"
elseif ASC( substr( cVData, i, 1 ) ) = 244 ; cTemp += "ô"
elseif ASC( substr( cVData, i, 1 ) ) = 245 ; cTemp += "õ"
elseif ASC( substr( cVData, i, 1 ) ) = 246 ; cTemp += "ö"
elseif ASC( substr( cVData, i, 1 ) ) = 247 ; cTemp += "÷"
elseif ASC( substr( cVData, i, 1 ) ) = 248 ; cTemp += "ø"
elseif ASC( substr( cVData, i, 1 ) ) = 249 ; cTemp += "ù"
elseif ASC( substr( cVData, i, 1 ) ) = 250 ; cTemp += "ú"
elseif ASC( substr( cVData, i, 1 ) ) = 251 ; cTemp += "û"
elseif ASC( substr( cVData, i, 1 ) ) = 252 ; cTemp += "ü"
elseif ASC( substr( cVData, i, 1 ) ) = 253 ; cTemp += "ý"
elseif ASC( substr( cVData, i, 1 ) ) = 254 ; cTemp += "þ"
elseif ASC( substr( cVData, i, 1 ) ) = 255 ; cTemp += "ÿ"
else
fwlog ">195 else", substr( cVData, i, 1 ), ASC( substr( cVData, i, 1 ) )
endif
endif
else
// fwlog "else" , substr( cVData, i, 1 )
cTemp += substr( cVData, i, 1 )
ENDIF
next
cVData := cTemp
return (cVData)
*----------------------------------------------------------
function wordumlaute( cVData, aufruf )
local I := 0
local nIdx := 0
local cTmp := ""
*----------------------------------------------------------
if VALType(aufruf) = "U"
else
cVData := STRTRAN( ALLTRIM( cVData ), ";", "," )
endif
// escaping
cVData := STRTRAN(cVData, CHR(38), "+38+" )
cVData := STRTRAN(cVData, CHR(228), "+ae+" )
cVData := STRTRAN(cVData, CHR(252), "+ue+" )
cVData := STRTRAN(cVData, CHR(246), "+oe+" )
cVData := STRTRAN(cVData, CHR(196), "+Ae+" )
cVData := STRTRAN(cVData, CHR(214), "+Oe+" )
cVData := STRTRAN(cVData, CHR(220), "+Ue+" )
cVData := STRTRAN(cVData, CHR(223), "+ss+" )
FOR I := 1 TO len(cVData)
IF ASC(substr(cVData,i,1)) = 10
cVData := STRTRAN( cVData, chr(10 ), " " )
endif
IF ASC(substr(cVData,i,1)) = 13
cVData := STRTRAN(cVData, chr( 13)," ")
endif
next
return (cVData)
//----------------------------------------------------------------------------//
function unescaping( cVData )
cVData := STRTRAN(cVData, "+38+" , "&" )
cVData := STRTRAN(cVData, "+ae+" , "ä" )
cVData := STRTRAN(cVData, "+ue+" , "ü" )
cVData := STRTRAN(cVData, "+oe+" , "ö" )
cVData := STRTRAN(cVData, "+Ae+" , "Ä" )
cVData := STRTRAN(cVData, "+Oe+" , "Ö" )
cVData := STRTRAN(cVData, "+Ue+" , "Ü" )
cVData := STRTRAN(cVData, "+ss+" , "ß" )
return( cVData )
//----------------------------------------------------------------------------//
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 59 guests