excilys/gatling — pull request #480 by nire (2012-04-17 14:23:56+00:00)
Title: Specify the encoding of simulation.log

Hi,

In FileDataReader.scala:49 - we specify the encoding while reading the simulation.log file :
Source.fromFile(simLogFile, configuration.encoding).getLines

But in FileDataWriter.scala:73, we don't specify the encoding while writing the simulation.log file :
osw = new OutputStreamWriter(new BufferedOutputStream(new FileOutputStream(simulationLogFile(runRecord.runUuid).toString)))

So, if we put no-ASCII characters in the scenario name like "Tête à toto", we get this exception :

Caused by: java.nio.charset.MalformedInputException: Input length = 1
at java.nio.charset.CoderResult.throwException(CoderResult.java:260)
at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:319)
at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:158)
at java.io.InputStreamReader.read(InputStreamReader.java:167)
at java.io.BufferedReader.fill(BufferedReader.java:136)
at java.io.BufferedReader.readLine(BufferedReader.java:299)
at java.io.BufferedReader.readLine(BufferedReader.java:362)
at scala.io.BufferedSource$BufferedLineIterator.hasNext(BufferedSource.scala:67)
at scala.collection.Iterator$$anon$19.hasNext(Iterator.scala:334)
at scala.collection.Iterator$class.foreach(Iterator.scala:660)
at scala.collection.Iterator$$anon$19.foreach(Iterator.scala:333)
at com.excilys.ebi.gatling.charts.result.reader.FileDataReader.(FileDataReader.scala:50)