always set charset to utf-8 when converting from bytes to string

This commit is contained in:
Craig Raw
2021-01-13 12:17:01 +02:00
parent fd7d2232a1
commit 38818d8222
9 changed files with 18 additions and 11 deletions
@@ -51,7 +51,7 @@ public class SpecterDesktop implements WalletImport, WalletExport {
public Wallet importWallet(InputStream inputStream, String password) throws ImportException {
try {
Gson gson = new Gson();
SpecterWallet specterWallet = gson.fromJson(new InputStreamReader(inputStream), SpecterWallet.class);
SpecterWallet specterWallet = gson.fromJson(new InputStreamReader(inputStream, StandardCharsets.UTF_8), SpecterWallet.class);
if(specterWallet.descriptor != null) {
OutputDescriptor outputDescriptor = OutputDescriptor.getOutputDescriptor(specterWallet.descriptor);