diff --git a/database/src/main/java/org/linguafranca/pwdb/PropertyValue.java b/database/src/main/java/org/linguafranca/pwdb/PropertyValue.java index 221020ff..9c8cb1b6 100644 --- a/database/src/main/java/org/linguafranca/pwdb/PropertyValue.java +++ b/database/src/main/java/org/linguafranca/pwdb/PropertyValue.java @@ -230,7 +230,7 @@ public BytesStore(byte [] value) { @Override public String getValueAsString() { - return new String(this.value); + return new String(this.value, StandardCharsets.UTF_8); } @Override @@ -415,7 +415,7 @@ public SealedStore(CharSequence charSequence) { @Override public String getValueAsString() { - return new String(getBytes()); + return new String(getBytes(), StandardCharsets.UTF_8); } @Override diff --git a/example/src/main/java/org/linguafranca/pwdb/kdbx/QuickStart.java b/example/src/main/java/org/linguafranca/pwdb/kdbx/QuickStart.java index 3ea075f5..f91dc774 100644 --- a/example/src/main/java/org/linguafranca/pwdb/kdbx/QuickStart.java +++ b/example/src/main/java/org/linguafranca/pwdb/kdbx/QuickStart.java @@ -84,6 +84,7 @@ public void saveKdbx() throws IOException { } // save to a file with password "123" + new File("testOutput").mkdirs(); try (FileOutputStream outputStream = new FileOutputStream("testOutput/test.kdbx")) { database.save(new KdbxCreds("123".getBytes()), outputStream); }