diff --git a/internal/sei/input_processors/csv.go b/internal/sei/input_processors/csv.go index 91e6015..b996ad4 100644 --- a/internal/sei/input_processors/csv.go +++ b/internal/sei/input_processors/csv.go @@ -19,10 +19,16 @@ type CSVFormat struct { } func CSVDecoder_Init(config csvConfig) (InputProcessor, error) { - return &CSVFormat{ + decoder := &CSVFormat{ delimiter: config.Delimiter, encodingConversionFile: config.EncodingConversionFile, - }, nil + } + + if decoder.encodingConversionFile != "" { + decoder.prepareEncodingConversionTable() + } + + return decoder, nil } func (c *CSVFormat) Process(sourceFile string, parser *parser.Parser) error { diff --git a/internal/sei/parser/parser.go b/internal/sei/parser/parser.go index 8ad0799..99a7e25 100644 --- a/internal/sei/parser/parser.go +++ b/internal/sei/parser/parser.go @@ -76,7 +76,7 @@ func (p *Parser) ProcessLine(fields []string) error { emptyLine = false - data[header] = value + data[header] = strings.TrimSpace(value) } if !emptyLine {