Skip to content

Commit

Permalink
Copy stream in single operation
Browse files Browse the repository at this point in the history
When converting from one encoding to another, copy the stream all at once to avoid accidentally splitting Unicode character blocks. See #186
  • Loading branch information
joyfullservice committed Mar 5, 2021
1 parent 801f39e commit fa2ba83
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions Version Control.accda.src/modules/modEncoding.bas
Original file line number Diff line number Diff line change
Expand Up @@ -303,10 +303,8 @@ Public Sub ReEncodeFile(strInputFile As String, strInputCharset As String, _
.Charset = strInputCharset
objOutputStream.Open
objOutputStream.Charset = strOutputCharset
' Copy data over by chunks to boost performance
Do While .EOS <> True
.CopyTo objOutputStream, clngChunkSize
Loop
' Copy from one stream to the other
.CopyTo objOutputStream
.Close
End With

Expand Down

0 comments on commit fa2ba83

Please sign in to comment.