Конвертирование
текста из DOS-кодировки в Windows |
|
Declare Function CharToOemBuff Lib "user32" Alias "CharToOemBuffA"_
(ByVal lpszSrc As String, ByVal lpszDst As String, ByVal cchDstLength As Long) As Long
Declare Function OemToCharBuff Lib "user32" Alias "OemToCharBuffA"_
(ByVal lpszSrc As String, ByVal lpszDst As String, ByVal cchDstLength As Long) As Long
Public Function ToAnsi(s As String) As String
Dim Buffer As String
Buffer = Space(Len(s) + 1)
OemToCharBuff s, Buffer, Len(s)
ToAnsi = Left(Buffer, Len(s))
End Function
Public Function ToOEM(s As String) As String
Dim Buffer As String
Buffer = Space(Len(s) + 1)
CharToOemBuff s, Buffer, Len(s)
ToOEM = Left(Buffer, Len(s))
End Function
ОБСУДИТЬ СТАТЬЮ
НА ФОРУМЕ