Buffer_MSG = IBM850UMLAUTS(BytesToString(Buffer, 0, Buffer.Length, "WINDOWS-1252"))
Sub IBM850UMLAUTS(S As String)
'ÄäÖöÜüß
'Ž„™”šá
S = StringReplaceAll(S,"Ž","Ä")
S = StringReplaceAll(S,"„","ä")
S = StringReplaceAll(S,"™","Ö")
S = StringReplaceAll(S,"”","ö")
S = StringReplaceAll(S,"š","Ü")
S = StringReplaceAll(S,"","ü")
S = StringReplaceAll(S,"á","ß")
Return S
End Sub
'Delphi StringReplaceAll
Sub StringReplaceAll(S As String, SS As String, SR As String)
Do While S.IndexOf(SS) <> -1
S = S.SubString2(0,S.IndexOf(SS)) & SR & S.SubString2(S.IndexOf(SS)+SS.Length, S.Length)
Loop
Return S
End Sub