Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/CSVTextStream.cls
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,7 @@ Private Function IsValidUTF8(byteData() As Byte) As Boolean
Dim i As Long
Dim ANSIfile As Boolean

On Error GoTo err_handler
i = 0
ANSIfile = True
While i <= UBound(byteData)
Expand Down Expand Up @@ -417,6 +418,9 @@ Private Function IsValidUTF8(byteData() As Byte) As Boolean
End If
Wend
IsValidUTF8 = Not ANSIfile
Exit Function
err_handler:
IsValidUTF8 = False
End Function
Private Sub NormalizeLineBreaks()
Do While InStrB(1, P_TEXT, vbCrLf, vbBinaryCompare)
Expand Down
3 changes: 2 additions & 1 deletion src/CSVinterface.cls
Original file line number Diff line number Diff line change
Expand Up @@ -793,7 +793,7 @@ Public Function GetDataFromCSV(csvPathAndFilename As String) As String
On Error GoTo ErrHandler_GetDataFromCSV
FileHandled = FreeFile
Open csvPathAndFilename For Binary As #FileHandled
GetDataFromCSV = SPACE$(LOF(FileHandled))
GetDataFromCSV = Space$(LOF(FileHandled))
Get #FileHandled, , GetDataFromCSV
Close #FileHandled
ErrHandler_GetDataFromCSV:
Expand Down Expand Up @@ -3573,6 +3573,7 @@ Private Sub StreamParseCSV(configObj As CSVparserConfig, _
CSVstream.linebreakMatchingBehavior = EndLineMatchingBehavior.OnlyBackwardSense
CSVstream.unifiedLFOutput = .multiEndOfLineCSV
CSVstream.utf8EncodedFile = .utf8EncodedFile
CSVstream.autoDetectEncoding = .autoDetectEncoding
CSVstream.OpenStream .path
commToken = AscW(.commentsToken)
dynamicType = .dynamicTyping
Expand Down