Repository: joernio/joern (scala)

Issue:
jssrc: code fields are wrong after a multi-byte character was encountered in the source code
```
joern> importCode.jssrc.fromString("""// 😼
       logger.error()
       """) 
res91: Cpg = Cpg (Graph [46 nodes])

joern> cpg.fieldAccess.argument(2).code.l 
res92: List[String] = List(".erro")
```

Pull request description:
Fixes: https://github.com/joernio/joern/issues/2087

Patch:
diff --git a/build.sbt b/build.sbt
index d8c79dd363ac..ff438a3b2fbe 100644
--- a/build.sbt
+++ b/build.sbt
@@ -2,7 +2,7 @@ name                     := "joern"
 ThisBuild / organization := "io.joern"
 ThisBuild / scalaVersion := "2.13.8"
 
-val cpgVersion = "1.3.583"
+val cpgVersion = "1.3.584"
 
 lazy val joerncli          = Projects.joerncli
 lazy val querydb           = Projects.querydb


Test patch:
diff --git a/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/io/ProjectParseTest.scala b/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/io/ProjectParseTest.scala
index 80fe30a9d793..990b1e4646db 100644
--- a/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/io/ProjectParseTest.scala
+++ b/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/io/ProjectParseTest.scala
@@ -33,6 +33,17 @@ class ProjectParseTest extends JsSrc2CpgSuite with BeforeAndAfterAll {
     dir
   }
 
+  private val projectWithUtf8: File = {
+    val dir  = File.newTemporaryDirectory("jssrc2cpgTestsUtf8")
+    val file = dir / "utf8.js"
+    file.createIfNotExists(createParents = true)
+    file.write("""
+        |// 😼
+        |logger.error()
+        |""".stripMargin)
+    dir
+  }
+
   override def afterAll(): Unit = {
     projectWithSubfolders.delete(swallowIOExceptions = true)
     projectWithBrokenFile.delete(swallowIOExceptions = true)
@@ -65,6 +76,10 @@ class ProjectParseTest extends JsSrc2CpgSuite with BeforeAndAfterAll {
       cpg.file.name.l should (contain("good.js") and not contain "broken.js")
     }
 
+    "handle utf8 correctly" in ProjectParseTestsFixture(projectWithUtf8) { cpg =>
+      cpg.fieldAccess.argument(2).code.l shouldBe List("error")
+    }
+
   }
 
 }