Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/fs.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

#include <boost/filesystem.hpp>
#include <boost/filesystem/fstream.hpp>
#include <boost/filesystem/detail/utf8_codecvt_facet.hpp>

/** Filesystem operations and types */
namespace fs = boost::filesystem;
Expand Down
6 changes: 2 additions & 4 deletions src/qt/guiutil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@
#include <QFontDatabase>
#endif

static fs::detail::utf8_codecvt_facet utf8;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Drop this because this convert between UTF-8 and UCS-2, not UTF-16. Use std::codecvt_utf8_utf16 instead.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Drop this because this convert between UTF-8 and UCS-2, not UTF-16. Use std::codecvt_utf8_utf16 instead.

This is documented at https://www.boost.org/doc/libs/1_68_0/boost/detail/utf8_codecvt_facet.hpp, in case anybody else is curious.


namespace GUIUtil {

QString dateTimeStr(const QDateTime &date)
Expand Down Expand Up @@ -764,12 +762,12 @@ void setClipboard(const QString& str)

fs::path qstringToBoostPath(const QString &path)
{
return fs::path(path.toStdString(), utf8);
return fs::path(path.toStdString());
Comment thread
laanwj marked this conversation as resolved.
Outdated
}

QString boostPathToQString(const fs::path &path)
{
return QString::fromStdString(path.string(utf8));
return QString::fromStdString(path.string());
}

QString formatDurationStr(int secs)
Expand Down
4 changes: 4 additions & 0 deletions src/util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1206,7 +1206,11 @@ void SetupEnvironment()
// A dummy locale is used to extract the internal default locale, used by
// fs::path, which is then used to explicitly imbue the path.
std::locale loc = fs::path::imbue(std::locale::classic());
#ifndef WIN32
fs::path::imbue(loc);
#else
fs::path::imbue(std::locale(loc, new std::codecvt_utf8_utf16<wchar_t>()));
#endif
}

bool SetupNetworking()
Expand Down
1 change: 0 additions & 1 deletion test/lint/lint-includes.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ EXPECTED_BOOST_INCLUDES=(
boost/chrono/chrono.hpp
boost/date_time/posix_time/posix_time.hpp
boost/filesystem.hpp
boost/filesystem/detail/utf8_codecvt_facet.hpp
boost/filesystem/fstream.hpp
boost/multi_index/hashed_index.hpp
boost/multi_index/ordered_index.hpp
Expand Down