Quote Originally Posted by dilettante View Post
If your files are not extremely large you could use the ADO Stream class for this (ADODB.Stream):

Example:

Code:
Option Explicit

'Requires a reference to:
'
'   Microsoft ActiveX Data Objects 2.5 Library (or later).

Private Sub Main()
    Dim StreamIn As ADODB.Stream
    Dim Header() As Byte
    Dim HasBOM As Boolean
    Dim StreamOut As ADODB.Stream

    Set StreamIn = New ADODB.Stream
    With StreamIn
        'Load "utf-8.txt" UTF-8 file, detect BOM and skip over if present:
        .Open
        .Type = adTypeBinary
        .LoadFromFile "utf-8.txt"
        If .Size >= 3 Then
            Header = .Read(3)
            HasBOM = Header(0) = &HEF And Header(1) = &HBB And Header(2) = &HBF
        End If
        .Position = 0 'Allows us to change to text mode and assign Charset.
        .Type = adTypeText
        .Charset = "utf-8"
    End With

    Set StreamOut = New ADODB.Stream
    With StreamOut
        'Copy the text to "windows-1256.txt" ANSI 1252 file:
        .Open
        .Charset = "windows-1256"
        .Type = adTypeText
        'Move to beginning:
        If HasBOM Then
            StreamIn.Position = 3
        Else
            StreamIn.Position = 0
        End If
        .WriteText StreamIn.ReadText(adReadAll)
        .SaveToFile "windows-1256.txt", adSaveCreateOverWrite
        .Close

        'Copy the text to "unicode.txt" UTF-16LE file:
        .Open
        .Charset = "unicode"
        .Type = adTypeText
        'Move to beginning:
        If HasBOM Then
            StreamIn.Position = 3
        Else
            StreamIn.Position = 0
        End If
        .WriteText StreamIn.ReadText(adReadAll)
        .SaveToFile "unicode.txt", adSaveCreateOverWrite
        .Close
    End With
    StreamIn.Close

    MsgBox "Finished"
End Sub
Regarding the Charset property:


Thank you dear friend
My file is a movie subtitle file

You can further explain this class