Skip to content

Commit 388c294

Browse files
committed
Update CSVTextStream.cls
1 parent cceeb96 commit 388c294

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/CSVTextStream.cls

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,7 @@ Private Function IsValidUTF8(byteData() As Byte) As Boolean
378378
Dim i As Long
379379
Dim ANSIfile As Boolean
380380

381+
On Error GoTo err_handler
381382
i = 0
382383
ANSIfile = True
383384
While i <= UBound(byteData)
@@ -417,6 +418,9 @@ Private Function IsValidUTF8(byteData() As Byte) As Boolean
417418
End If
418419
Wend
419420
IsValidUTF8 = Not ANSIfile
421+
Exit Function
422+
err_handler:
423+
IsValidUTF8 = False
420424
End Function
421425
Private Sub NormalizeLineBreaks()
422426
Do While InStrB(1, P_TEXT, vbCrLf, vbBinaryCompare)

0 commit comments

Comments
 (0)