From c66a842ce4679a3ffa5504dad39b1402bea75e9f Mon Sep 17 00:00:00 2001 From: Lukasz Kasprzak Date: Mon, 14 Sep 2026 23:07:57 +0200 Subject: plan 10 re-check: cut run column, damaged undo run, emptied directory cleanup, text turning binary, explain flags, interrupt docs --- internal/extract/plain.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'internal/extract/plain.go') diff --git a/internal/extract/plain.go b/internal/extract/plain.go index d245a41..f7470be 100644 --- a/internal/extract/plain.go +++ b/internal/extract/plain.go @@ -38,7 +38,7 @@ func readDecoded(path string) (string, error) { // the sample alone (UTF-16 text is full of NUL bytes by design), but a // sample that merely looks like UTF-8 must hold for the WHOLE file — no // NUL byte anywhere, and no invalid UTF-8 anywhere past the sample — or -// the file is ErrUnsupported after all; the Latin-1 fallback in decode +// the file is ErrMixed, unreadable; the Latin-1 fallback in decode // never applies to a sniffed file, only to a file whose extension already // names it as text. D2: when the file continues past the sample (n == // sniffSize), the validity check is run against a trimmed copy with any @@ -81,7 +81,7 @@ func sniffText(path string) (string, error) { return decode(data), nil } if !utf8.Valid(data) || bytes.Contains(data, []byte{0}) { - return "", ErrUnsupported + return "", ErrMixed } return decode(data), nil } -- cgit v1.3