From be060abe10909f1245cdd981373ed3a420203e44 Mon Sep 17 00:00:00 2001 From: sowle Date: Thu, 26 Sep 2019 01:08:17 +0300 Subject: [PATCH] filesystem unicode refactoring: serialize_obj_to_file, unserialize_obj_from_file --- src/common/boost_serialization_helper.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/common/boost_serialization_helper.h b/src/common/boost_serialization_helper.h index 37932899..2ba8a52c 100644 --- a/src/common/boost_serialization_helper.h +++ b/src/common/boost_serialization_helper.h @@ -21,8 +21,8 @@ namespace tools bool serialize_obj_to_file(t_object& obj, const std::string& file_path) { TRY_ENTRY(); - std::ofstream data_file; - data_file.open( file_path , std::ios_base::binary | std::ios_base::out| std::ios::trunc); + boost::filesystem::ofstream data_file; + data_file.open( epee::string_encoding::utf8_to_wstring(file_path) , std::ios_base::binary | std::ios_base::out| std::ios::trunc); if(data_file.fail()) return false; @@ -64,8 +64,8 @@ namespace tools { TRY_ENTRY(); - std::ifstream data_file; - data_file.open( file_path, std::ios_base::binary | std::ios_base::in); + boost::filesystem::ifstream data_file; + data_file.open( epee::string_encoding::utf8_to_wstring(file_path), std::ios_base::binary | std::ios_base::in); if(data_file.fail()) return false; boost::archive::binary_iarchive a(data_file);