From 372197a1dacc55aebcb42b934db76d9721e4b4fe Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Mon, 14 Feb 2022 12:25:45 +0100 Subject: [client] Virtconfig editor: Use UTF-8 as default encoding for non-vmware --- .../java/org/openslx/dozmod/gui/window/VirtConfigEditorWindow.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'dozentenmodul/src') diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/VirtConfigEditorWindow.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/VirtConfigEditorWindow.java index 1818323d..cc841b16 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/VirtConfigEditorWindow.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/VirtConfigEditorWindow.java @@ -89,7 +89,11 @@ public class VirtConfigEditorWindow extends VirtConfigEditorWindowLayout impleme final String userInput = pnlEditor.getText(); byte[] uiBytes = userInput.getBytes(StandardCharsets.ISO_8859_1); Charset cs = VirtualizationConfigurationVmwareFileFormat.getCharset(uiBytes, uiBytes.length); - // cs is now either the detected encoding, or latin1 as a default + // VMware: cs is now either the detected encoding, or latin1 as a default + // Other: Should be null, so let's go with UTF-8 + if (cs == null) { + cs = StandardCharsets.UTF_8; + } uiBytes = userInput.getBytes(cs); // now we should have the correct bytes... VirtualizationConfiguration virtualizationConfig = null; -- cgit v1.2.3-55-g7522