mirror of
https://github.com/songoda/SongodaCore.git
synced 2024-12-27 10:57:45 +01:00
UTF-16 uses non-parity definition for saving
This commit is contained in:
parent
445b47c581
commit
577cbee31a
@ -165,6 +165,16 @@ public class Config extends ConfigSection {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the default charset to use UTF-16
|
||||
*
|
||||
* @return this class
|
||||
*/
|
||||
public Config setUseUTF16() {
|
||||
this.defaultCharset = StandardCharsets.UTF_16;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean getAutosave() {
|
||||
return autosave;
|
||||
}
|
||||
@ -370,7 +380,7 @@ public class Config extends ConfigSection {
|
||||
Charset charset = TextUtils.detectCharset(stream, StandardCharsets.UTF_8);
|
||||
// upgrade charset if file was saved in a more complex format
|
||||
if(charset == StandardCharsets.UTF_16BE || charset == StandardCharsets.UTF_16LE) {
|
||||
defaultCharset = charset;
|
||||
defaultCharset = StandardCharsets.UTF_16;
|
||||
}
|
||||
this.load(new InputStreamReader(stream, charset));
|
||||
return true;
|
||||
|
Loading…
Reference in New Issue
Block a user