Use name() instead of toString() on StandardCharsets.UTF_8

Apparently toString() doesn't produce the same result on every platform.
This commit is contained in:
Alexander Bakker 2021-01-08 17:38:02 +01:00
parent dea13f56f5
commit 737b9da292

View file

@ -173,7 +173,7 @@ public class VaultManager {
* Google Authenticator URI's and writing it to the given OutputStream. * Google Authenticator URI's and writing it to the given OutputStream.
*/ */
public void exportGoogleUris(OutputStream outStream) throws VaultManagerException { public void exportGoogleUris(OutputStream outStream) throws VaultManagerException {
try (PrintStream stream = new PrintStream(outStream, false, StandardCharsets.UTF_8.toString())) { try (PrintStream stream = new PrintStream(outStream, false, StandardCharsets.UTF_8.name())) {
for (VaultEntry entry : getEntries()) { for (VaultEntry entry : getEntries()) {
GoogleAuthInfo info = new GoogleAuthInfo(entry.getInfo(), entry.getName(), entry.getIssuer()); GoogleAuthInfo info = new GoogleAuthInfo(entry.getInfo(), entry.getName(), entry.getIssuer());
stream.println(info.getUri().toString()); stream.println(info.getUri().toString());