question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Japanese is garbled

See original GitHub issue

Description of the issue:

Japanese is garbled.

fun main() {
    println("Hello 日本語")
}

output

$ ./gradlew jibDockerBuild
$ docker run -it --rm ${IMAGE ID}
Hello ???

Expected behavior:

$ docker run -it --rm ${IMAGE ID}
Hello 日本語

Steps to reproduce:

I created repository for this issue.

https://github.com/sakebook/jib-utf8

Environment:

  • Mac OS 10.13.6
  • Gradle

jib-gradle-plugin Configuration:

import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
    kotlin("jvm") version "1.3.0"
    id("com.google.cloud.tools.jib") version "0.9.13"
}

group = "com.github.sakebook"
version = "0.0.1"

repositories {
    mavenCentral()
}

dependencies {
    compile(kotlin("stdlib-jdk8"))
}

tasks.withType<KotlinCompile> {
    kotlinOptions.jvmTarget = "1.8"
}

Log output:

Additional Information:

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
briandealwiscommented, Nov 8, 2018

@sakebook in the meantime, here’s a quick workaround:

diff --git a/build.gradle.kts b/build.gradle.kts
index d678bab..e012b4d 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -16,6 +17,17 @@ dependencies {
     compile(kotlin("stdlib-jdk8"))
 }
 
+jib {
+  // from {image = "openjdk:8"}
+  container {
+    jvmFlags = listOf("-Dfile.encoding=UTF-8")
+  }
+}

I’ll open an issue on distroless/java.

0reactions
sakebookcommented, Nov 9, 2018

Hmm… I see.

Thank you for your workaround!

And distroless/java issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Japanese characters are garbled when viewing Log File ... - IBM
Japanese characters in log files (For example: DS_System.X; HealthSnapshotLogger.X; JobManagerLogger.X) are garbled when using "View Log" or " ...
Read more >
Japanese characters in Group emails are garbled or missing ...
When sending Office 365 Group emails in Plain Text with Hiragana letters (Japanese Characters), the resulting emails may have missing or garbled ...
Read more >
Convert garbled Japanese text back to readable Japanese
I have a file with garbled Japanese text and need to convert it back to readable Japanese. The problem is that a) I...
Read more >
Japanese characters is garbled on Windows. - xtUML
I use BridgePoint on Windows 11. I can write Japanese sentence in text editor but the sentence at the moment of saving becomes...
Read more >
Japanese character is garbled when we run the query ...
Japanese character is garbled when we run the query (Community). Avatar. Looker Support. 9 months ago; Updated. Follow. View the original community article ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found