Skip to content

Commit

Permalink
escape \n\r for csv ouputs
Browse files Browse the repository at this point in the history
  • Loading branch information
Guillaume Simonneau committed Mar 3, 2020
1 parent 3c6a5f9 commit a665499
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sqlavro/query.result.csv.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ func query2CSV(cfg QueryConfig) (csvBytes []byte, newCriteria []Criterion, err e
return nil, nil, err
}
for fieldName := range record {
record[fieldName] = strings.ReplaceAll(record[fieldName], "\n", "U+240A")
record[fieldName] = strings.ReplaceAll(record[fieldName], "\r", "U+240D")
record[fieldName] = strings.ReplaceAll(record[fieldName], "\n", "\\n")
record[fieldName] = strings.ReplaceAll(record[fieldName], "\r", "\\r")
}
records = append(records, record)
}
Expand Down

0 comments on commit a665499

Please sign in to comment.