|
18 | 18 | #include "wallet/wallet_rpc_server.h" |
19 | 19 | #include "crypto/mnemonic-encoding.h" |
20 | 20 | #include "version.h" |
| 21 | +#include "string_coding.h" |
21 | 22 |
|
22 | 23 | #if defined(WIN32) |
23 | 24 | #include <crtdbg.h> |
@@ -337,7 +338,7 @@ bool simple_wallet::new_wallet(const string &wallet_file, const std::string& pas |
337 | 338 | std::vector<unsigned char> restore_seed; |
338 | 339 | try |
339 | 340 | { |
340 | | - restore_seed = m_wallet->generate(wallet_file, password); |
| 341 | + restore_seed = m_wallet->generate(string_encoding::convert_to_unicode(wallet_file), password); |
341 | 342 | message_writer(epee::log_space::console_color_white, true) << "Generated new wallet: " << m_wallet->get_account().get_public_address_str(); |
342 | 343 | std::cout << "view key: " << string_tools::pod_to_hex(m_wallet->get_account().get_keys().m_view_secret_key) << std::endl << std::flush; |
343 | 344 | } |
@@ -375,7 +376,7 @@ bool simple_wallet::restore_wallet(const std::string &wallet_file, const std::st |
375 | 376 | try |
376 | 377 | { |
377 | 378 | std::vector<unsigned char> seed = crypto::mnemonic_encoding::text2binary(restore_seed); |
378 | | - m_wallet->restore(wallet_file, seed, password); |
| 379 | + m_wallet->restore(epee::string_encoding::convert_to_unicode(wallet_file), seed, password); |
379 | 380 | message_writer(epee::log_space::console_color_white, true) << "Wallet restored: " << m_wallet->get_account().get_public_address_str(); |
380 | 381 | std::cout << "view key: " << string_tools::pod_to_hex(m_wallet->get_account().get_keys().m_view_secret_key) << std::endl << std::flush; |
381 | 382 | } |
@@ -408,7 +409,7 @@ bool simple_wallet::open_wallet(const string &wallet_file, const std::string& pa |
408 | 409 |
|
409 | 410 | try |
410 | 411 | { |
411 | | - m_wallet->load(m_wallet_file, password); |
| 412 | + m_wallet->load(epee::string_encoding::convert_to_unicode(m_wallet_file), password); |
412 | 413 | message_writer(epee::log_space::console_color_white, true) << "Opened wallet" << (m_wallet->is_view_only() ? "watch-only" : "" ) << ": " << m_wallet->get_account().get_public_address_str(); |
413 | 414 | } |
414 | 415 | catch (const std::exception& e) |
@@ -1042,7 +1043,7 @@ bool simple_wallet::save_watch_only(const std::vector<std::string> &args) |
1042 | 1043 | } |
1043 | 1044 | try |
1044 | 1045 | { |
1045 | | - m_wallet->store_keys(args[0], args[1], true); |
| 1046 | + m_wallet->store_keys(string_encoding::convert_to_unicode(args[0]), args[1], true); |
1046 | 1047 | success_msg_writer() << "Keys stored to " << args[0]; |
1047 | 1048 | } |
1048 | 1049 | catch (const std::exception& e) |
@@ -1825,7 +1826,7 @@ int main(int argc, char* argv[]) |
1825 | 1826 | try |
1826 | 1827 | { |
1827 | 1828 | LOG_PRINT_L0("Loading wallet..."); |
1828 | | - wal.load(wallet_file, wallet_password); |
| 1829 | + wal.load(string_encoding::convert_to_unicode(wallet_file), wallet_password); |
1829 | 1830 | wal.init(daemon_address); |
1830 | 1831 | if (!offline_mode) |
1831 | 1832 | wal.refresh(); |
|
0 commit comments