Use UTF-8 when getting strings from configmaps. Fixes #1007

This commit is contained in:
Ryan Baxter
2022-04-28 09:32:28 -04:00
parent 561e67e360
commit 3cff32028a

View File

@@ -19,6 +19,8 @@ package org.springframework.cloud.kubernetes.commons.config;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.UncheckedIOException;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.util.Map;
import java.util.Properties;
import java.util.function.BinaryOperator;
@@ -96,7 +98,7 @@ public final class PropertySourceUtils {
}
return ABSTAIN;
});
yamlFactory.setResources(new ByteArrayResource(s.getBytes()));
yamlFactory.setResources(new ByteArrayResource(s.getBytes(StandardCharsets.UTF_8)));
return yamlFactory.getObject();
};
}