TopPicLogo TopPicText

Перекодирование строки в CP-866 и обратно в WIN-12

По материалам : http://www.sql.ru/forum/

Public Declare Function OemToChar Lib "user32" Alias "OemToCharA" (ByVal StrFrom As String, ByVal StrTo As String) As Long
Public Declare Function CharToOem Lib "user32" Alias "CharToOemA" (ByVal lpszSrc As String, ByVal lpszDst As String) As Long

Public Function OEM2ANSI(ByVal sOem As String) As String
    Dim sAnsi As String
    sAnsi = String(Len(sOem), Chr(0))
    OemToChar sOem, sAnsi
    OEM2ANSI = sAnsi
End Function

Public Function ANSI2OEM(ByVal sAnsi As String) As String
    Dim sOem As String
    sOem = String(Len(sAnsi), Chr(0))
    CharToOem sAnsi, sOem
    ANSI2OEM = sOem
End Function
Назад ToTop
L.E. 24.07.2016
Рейтинг@Mail.ru