diff options
| author | Tomas Bzatek <tbzatek@users.sourceforge.net> | 2008-06-08 13:52:16 +0200 |
|---|---|---|
| committer | Tomas Bzatek <tbzatek@users.sourceforge.net> | 2008-06-08 13:52:16 +0200 |
| commit | 226843b5d3c171734426756ceecba13817294eb9 (patch) | |
| tree | b8c3a70aadca63c9db21cf10f90af626712bc728 /UViewer.pas | |
| parent | 6c78adaf82d11bb1ae074b822d76891e004f4ae3 (diff) | |
| download | tuxcmd-226843b5d3c171734426756ceecba13817294eb9.tar.xz | |
Internal viewer: detect file encoding from the first 100 lines only
Diffstat (limited to 'UViewer.pas')
| -rw-r--r-- | UViewer.pas | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/UViewer.pas b/UViewer.pas index 70d3a64..4169b6a 100644 --- a/UViewer.pas +++ b/UViewer.pas @@ -392,7 +392,7 @@ begin LineBuffer.LoadFromFile(FileName); Valid := True; - for i := 0 to LineBuffer.Count - 1 do begin + for i := 0 to Min(100, LineBuffer.Count - 1) do begin Valid := Valid and g_utf8_validate(PChar(LineBuffer[i]), Length(LineBuffer[i]), nil); if not Valid then begin DebugMsg(['** TFViewer.LoadFile(', FileName, ', Line ', i + 1, ') is not UTF-8 valid.']); |
