Skip to content

Commit

Permalink
CSV: CsvToMap default charset (#1182)
Browse files Browse the repository at this point in the history
Honor `charset` parameter in `CsvToMap.withHeadersAsStrings`
  • Loading branch information
niqdev authored and ennru committed Sep 3, 2018
1 parent 84db4a5 commit b107b80
Showing 1 changed file with 2 additions and 2 deletions.
Expand Up @@ -40,12 +40,12 @@ object CsvToMap {
/**
* A flow translating incoming [[scala.List]] of [[akka.util.ByteString]] to a map of String keys and values using the given headers
* as keys.
* @param charset the charset to decode [[akka.util.ByteString]] to [[scala.Predef.String]], defaults to UTF-8
* @param charset the charset to decode [[akka.util.ByteString]] to [[scala.Predef.String]]
* @param headers column names to be used as map keys
*/
def withHeadersAsStrings(
charset: Charset,
headers: String*
): Flow[List[ByteString], Map[String, String], NotUsed] =
Flow.fromGraph(new CsvToMapAsStringsStage(Some(headers.toList), StandardCharsets.UTF_8))
Flow.fromGraph(new CsvToMapAsStringsStage(Some(headers.toList), charset))
}

0 comments on commit b107b80

Please sign in to comment.