Skip to content

Commit

Permalink
Windows requires explicit u8string in order to support utf8 characters
Browse files Browse the repository at this point in the history
  • Loading branch information
XapaJIaMnu committed Mar 3, 2019
1 parent 50652e2 commit a45693a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions file_utilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,15 @@ class fileCopier {

void copy(std::string& path) {
fs::path filepath(path);
fs::path hypofile = fs::path(savedir.string() + std::string("/") + filepath.filename().string());
fs::path hypofile = fs::path(savedir.u8string() + std::string("/") + filepath.filename().u8string());
if (!fs::exists(hypofile)) {
fs::copy(filepath, savedir);
}
}

void uncopy(std::string& path) {
fs::path origfile(path);
fs::path hypofile = fs::path(savedir.string() + std::string("/") + origfile.filename().string());
fs::path hypofile = fs::path(savedir.u8string() + std::string("/") + origfile.filename().u8string());
if (fs::exists(hypofile)) {
fs::remove(hypofile);
}
Expand Down

0 comments on commit a45693a

Please sign in to comment.