mirror of https://github.com/halo-dev/halo
Fix the problem of not being able to setup in OS without UTF-8 as default encoding (#7379)
#### What type of PR is this? /kind bug #### What this PR does / why we need it: This PR manually set UTF-8 charset while loading YAML file to fix the problem "java.nio.charset.MalformedInputException: Input length = 1". #### Which issue(s) this PR fixes: Fixes https://github.com/halo-dev/halo/issues/6937 Fixes https://github.com/orgs/halo-dev/discussions/7375 #### Does this PR introduce a user-facing change? ```release-note 修复 Windows 下可能无法正常初始化的问题 ```pull/7386/head
parent
ed50a0224d
commit
c2819f1f5a
|
@ -289,7 +289,8 @@ public class SystemSetupEndpoint {
|
|||
var processedContent =
|
||||
PROPERTY_PLACEHOLDER_HELPER.replacePlaceholders(rawContent, properties);
|
||||
// load yaml to unstructured
|
||||
var stringResource = new InMemoryResource(processedContent);
|
||||
var stringResource =
|
||||
new InMemoryResource(processedContent.getBytes(StandardCharsets.UTF_8));
|
||||
var loader = new YamlUnstructuredLoader(stringResource);
|
||||
return loader.load();
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue