Documentation
¶
Overview ¶
Package encoding resolves legacy text charset names and decodes their bytes to UTF-8. It exists so the config loader can validate a declared charset at startup and the ingest pipeline can apply the same resolution at read time, without either package importing the other.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Decoder ¶
type Decoder struct {
// contains filtered or unexported fields
}
Decoder converts a legacy-encoded byte slice to UTF-8.
func Lookup ¶
Lookup resolves a charset name or alias (e.g. "windows-1250", "cp1252", "ISO-8859-2") through the IANA index. It returns an error for an empty, unknown, or unsupported name so a bad declaration is caught at config load rather than per-file mid-ingest. UTF-8 resolves to a Decoder whose Decode is an identity check, which keeps an explicit `charset = "utf-8"` rule legal.