Invalid characters for a wallet name, e.g. bitcoin-qt -wallet=你好
used to result in an error like this
But now it just crashes:
I didn’t do a git bisect
, but it broke somewhere this year :-)
Invalid characters for a wallet name, e.g. bitcoin-qt -wallet=你好
used to result in an error like this
But now it just crashes:
I didn’t do a git bisect
, but it broke somewhere this year :-)
For the scope of this ticket, I’m happy if unicode wallet names throw an error message, instead of crashing. That’s assuming this was always the case, because otherwise users get locked out of old wallets (or they’d have to rename the file).
I think unicode already works on my machine (a6f00ce66f):
It’s just passing characters in at launch that seems broken.
Although it won’t let me add such characters to bitcoin.conf either:
After save:
This might be expect behavior; at least Windows clearly warns against doing this.
Actually it’s more complicated. As the page @ken2812221 links to points out, there are applications that don’t support Unicode, and for those Windows can switch the language (system wide). That probably includes the shel, the launch-from-search feature I used and the ANSI encoded file Notepad complained about.
It’s a bit hard to find in Windows 10, maybe this helps:
Don’t worry, this will not change your entire desktop into Mandarin. But now you can do this without a crash:
This neatly creates the wallet:
But the RPC gets confused:
And that’s where #13426 shows its magic:
Confirmed that the issue still exists on current master. Also with an assertion hit:
This seems to be the cause: https://github.com/bitcoin/bitcoin/commit/26c06f24e5dcc32a7599abb8d670d22993c82bc2#diff-3b23ce4d86903a432863cfb3a1f1e547L238
I am not sure how to fix this, since I can’t see the exception that is thrown on this file name.
We might just add to the release notes that windows users should only use ascii-filenames that are valid under windows?
SanitizeString
the filename component of the path?
SanitizeString
seem to make the wallet filename be ASCII only. Do we want to do that?