fb:porticula NoPaste
AnsiiToAscii-TestCode :D
Uploader: | ytwinky |
Datum/Zeit: | 22.08.2007 20:35:48 |
#include "windows.bi"
FUNCTION yANSI2ASCII (BYVAL ConvertString AS STRING) AS STRING
DIM OutString AS STRING=ConvertString
Dim s As String=!"??'\34.^%S<O???Z''\34\34\7--~Ts>o?zYϾݑ" &_
"ǎԐѥ噞 ᅃƄФ"
FOR i AS INTEGER=0 TO LEN(OutString)-1
If OutString[i]>127 And OutString[i]<256 Then OutString[i]=s[OutString[i]-128]
NEXT i
RETURN OutString
END FUNCTION
FUNCTION uANSI2ASCII (BYVAL ConvertString AS STRING) AS STRING
DIM AS STRING OutString=ConvertString
Static As Integer AscAnsDat(128)={ _
63, 63, 39, 159, 34, 46, 197, 206, 94, 37, 83, 60, 79, 63, 63, 63, _
90, 39, 39, 34, 34, 7, 45, 45, 126, 84, 115, 62, 111, 63, 122, 89, _
255, 173, 189, 156, 207, 190, 221, 145, 149, 184, 166, 174, 170, 240, 169, 238, _
248, 241, 253, 252, 239, 230, 244, 250, 247, 251, 167, 175, 172, 171, 243, 168, _
183, 181, 182, 199, 142, 143, 146, 128, 212, 144, 210, 211, 222, 214, 215, 216, _
209, 165, 227, 224, 226, 229, 153, 158, 157, 235, 233, 234, 154, 237, 232, 160, _
225, 133, 131, 198, 132, 134, 145, 135, 138, 130, 136, 137, 141, 161, 140, 139, _
208, 164, 149, 162, 147, 228, 148, 246, 155, 151, 163, 150, 129, 236, 231, 152}
FOR i AS INTEGER=0 TO LEN(OutString)-1
If OutString[i]>127 And OutString[i]<256 Then OutString[i]=AscAnsDat(OutString[i]-128)
NEXT i
RETURN OutString
END FUNCTION
Dim As String Ori="ߎę֚", Ansi=Ori, Ascii=Space(Len(Ansi))
?yANSI2ASCII (Ansi)
CharToOem Ansi, Ascii
?Ascii
?"Warum nehm ich nicht gleich die von volta vorgeschlagene Lsung?"
?"Da hab ich auch gleich noch die Rckumwandlung.. ;-))"
Sleep