Skip to content

Commit e52f872

Browse files
author
Johannes Düsing
committed
Fixed encoding errors when loading resources on windwos machines
1 parent 957d109 commit e52f872

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/main/scala/de/upb/cs/swt/delphi/webapi/FeatureQuery.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ import org.slf4j.LoggerFactory
2424
import spray.json._
2525
import de.upb.cs.swt.delphi.webapi.FeatureJson._
2626

27-
import scala.io.Source
27+
import scala.io.{Codec, Source}
2828

2929
class FeatureQuery(configuration: Configuration) {
3030
private val log = LoggerFactory.getLogger(this.getClass)
3131

3232
lazy val featureList: Iterable[Feature] =
33-
Source.fromResource("features.json")
33+
Source.fromResource("features.json")(Codec.UTF8)
3434
.getLines()
3535
.mkString("\n")
3636
.parseJson

src/main/scala/de/upb/cs/swt/delphi/webapi/artifacts/ArtifactTransformer.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ import de.upb.cs.swt.delphi.webapi.InternalFeature
2222
import org.joda.time.format.ISODateTimeFormat
2323
import spray.json.JsArray
2424

25-
import scala.io.Source
25+
import scala.io.{Codec, Source}
2626
import spray.json._
2727
import de.upb.cs.swt.delphi.webapi.FeatureJson._
2828
import de.upb.cs.swt.delphi.webapi.search.SearchResults
2929

3030
object ArtifactTransformer {
31-
private lazy val internalFeatures = Source.fromResource("features.json")
31+
private lazy val internalFeatures = Source.fromResource("features.json")(Codec.UTF8)
3232
.getLines()
3333
.mkString("\n")
3434
.parseJson

src/main/scala/de/upb/cs/swt/delphi/webapi/search/SearchQuery.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import de.upb.cs.swt.delphi.webapi.artifacts.ArtifactTransformer
2727
import de.upb.cs.swt.delphi.webapi.{Configuration, Feature, FeatureQuery, InternalFeature}
2828
import spray.json.JsArray
2929

30-
import scala.io.Source
30+
import scala.io.{Codec, Source}
3131
import scala.util.{Failure, Success, Try}
3232
import spray.json._
3333
import de.upb.cs.swt.delphi.webapi.FeatureJson._
@@ -36,7 +36,7 @@ import de.upb.cs.swt.delphi.webapi.FeatureJson._
3636
class SearchQuery(configuration: Configuration, featureExtractor: FeatureQuery) {
3737
private val client = ElasticClient(configuration.elasticsearchClientUri)
3838

39-
lazy val internalFeatures = Source.fromResource("features.json")
39+
lazy val internalFeatures = Source.fromResource("features.json")(Codec.UTF8)
4040
.getLines()
4141
.mkString("\n")
4242
.parseJson

0 commit comments

Comments
 (0)