diff --git a/bnn.go b/bnn.go index d5c43b0..aaa4bf1 100755 --- a/bnn.go +++ b/bnn.go @@ -6,6 +6,8 @@ import ( "os" "strconv" "strings" + + "golang.org/x/text/encoding/charmap" ) // Info Structure of headline @@ -145,6 +147,13 @@ func ReadBnn(r io.Reader) (Bnn, error) { for i, line := range lines { var item Item + // Encoding ASCII + // Example file for ASCII was provided by Paxan + // Extended ASCII has been used -> รค 132 \u0084 + if strings.Split(line, ";")[2] == "0" { + line, _ = charmap.CodePage850.NewDecoder().String(line) + } + col := strings.Split(line, ";") // Headline contains infos