skaffold icon indicating copy to clipboard operation
skaffold copied to clipboard

skaffold destroys umlauts

Open jfabianmeier opened this issue 8 months ago • 3 comments

skaffold v2.13.2 on Windows 10 destroys umlauts that appear in the build log output. This happens for jib, maven and even for simple things like custom buildCommand command like

echo "Hallo Überschall"

which becomes

"Hallo �berschall"

The Google Cloud Code plugin in IntelliJ stops filling the console the moment it hits such a broken output line. So using skaffold through the Google Cloud Code plugin, you cannot see any build results or logs after the broken line.

I have not found a way to configure encoding for skaffold or fixing this problem in any other way.

jfabianmeier avatar Mar 27 '25 15:03 jfabianmeier

The reason for the error is: The Windows cmd.exe is started and the output is written to an io.Writer without conversion from Windows encoding to UTF8.

One example is pkg/skaffold/build/custom/script.go in line 67:

if runtime.GOOS == "windows" {
	cmd = exec.CommandContext(ctx, "cmd.exe", "/C", command)
} else {
	cmd = exec.CommandContext(ctx, "sh", "-c", command)
}
cmd.Stdout = out
cmd.Stderr = out

jfabianmeier avatar Apr 19 '25 11:04 jfabianmeier

Corrected for custom and jib builds in https://github.com/jfabianmeier/skaffold/tree/umlauts-9768

jfabianmeier avatar Apr 21 '25 08:04 jfabianmeier