Lint fixes.

This commit is contained in:
2024-11-01 10:10:42 +02:00
parent ef3f009709
commit a0563074ed
9 changed files with 42 additions and 49 deletions

View File

@@ -20,6 +20,7 @@ func EnsureValidUTF8(input []byte) (string, error) {
charmap.Windows1252.NewDecoder(), // Then try Windows-1252, etc
// TODO: Try more encodings?
}
// First successful conversion wins
for _, encoding := range encodings {
reader := transform.NewReader(bytes.NewReader(inputNoNull), encoding)
result, err := io.ReadAll(reader)