Fix #13103
We can call .u8string() everywhere and call .string() when we need to use native-encoded path.
[WIP] Wrap C++17 std::filesystem::path to solve encoding issue on Windows. #13195
pull ken2812221 wants to merge 5 commits into bitcoin:master from ken2812221:u8path changing 37 files +295 −225-
ken2812221 commented at 5:09 AM on May 9, 2018: contributor
- ken2812221 force-pushed on May 9, 2018
- ken2812221 force-pushed on May 9, 2018
-
laanwj commented at 5:36 AM on May 9, 2018: member
Neat. Concept ACK!
- fanquake added the label Utils/log/libs on May 9, 2018
- ken2812221 force-pushed on May 9, 2018
-
fanquake commented at 6:14 AM on May 9, 2018: member
Travis macOS build failed with:
In file included from util.cpp:6: In file included from ./util.h:18: In file included from ./fs.h:11: In file included from /home/travis/build/bitcoin/bitcoin/depends/x86_64-apple-darwin11/share/../include/boost/filesystem.hpp:16: /home/travis/build/bitcoin/bitcoin/depends/x86_64-apple-darwin11/share/../include/boost/filesystem/path.hpp:141:33: error: no type named 'type' in 'boost::enable_if<boost::filesystem::path_traits::is_pathable<Path>, void>'; 'enable_if' cannot be used to disable this declaration typename boost::enable_if<path_traits::is_pathable< ^~~~~~~~~~~~~~~~~~~~~~~~~ ./util.h:315:36: note: in instantiation of member function 'boost::filesystem::path::path' requested here using boost::filesystem::path::path; ^ util.cpp:1098:12: note: while substituting deduced template arguments into function template 'Path' [with Source = Path] return Path(Utf8ToNative(source)); ^ 1 error generated. - ken2812221 force-pushed on May 9, 2018
- ken2812221 force-pushed on May 9, 2018
- ken2812221 force-pushed on May 9, 2018
- ken2812221 force-pushed on May 9, 2018
- ken2812221 force-pushed on May 9, 2018
-
in src/util.h:312 in 14a2574690 outdated
308 | @@ -309,4 +309,13 @@ std::unique_ptr<T> MakeUnique(Args&&... args) 309 | */ 310 | int ScheduleBatchPriority(void); 311 | 312 | +class Path : public boost::filesystem::path
laanwj commented at 8:15 AM on May 9, 2018:Would be better in
src/fs.h?in src/util.cpp:1026 in 14a2574690 outdated
1021 | @@ -1020,3 +1022,45 @@ int ScheduleBatchPriority(void) 1022 | return 1; 1023 | #endif 1024 | } 1025 | + 1026 | +static std::string NativeToUtf8(const std::string& source)
laanwj commented at 8:16 AM on May 9, 2018:string encoding should probably be in
utilstrencodings.[ch]laanwj requested review from theuni on May 9, 2018laanwj commented at 8:25 AM on May 9, 2018: memberFix #13103
How does this fix that issue? This adds a class and some functions, but never uses them, or am I missing something?
We can call .u8string() everywhere and call .string() when we need to use native-encoded path.
Concept ACK, though I'm not entirely convinced on wrapping versus using functions where needed.
ken2812221 commented at 8:34 AM on May 9, 2018: contributorken2812221 force-pushed on May 9, 2018ken2812221 force-pushed on May 9, 2018ken2812221 force-pushed on May 9, 2018ken2812221 force-pushed on May 9, 2018ken2812221 force-pushed on May 9, 2018ken2812221 force-pushed on May 9, 2018ken2812221 force-pushed on May 9, 2018ken2812221 force-pushed on May 9, 2018[WIP] Wrap C++17 std::filesystem::path to solve encoding issue on Windows 641517d8e9d98cc4eaa8scripted-diff: Use fsbridge::Path instead of boost::filesystem::path
-BEGIN VERIFY SCRIPT- sed -i 's/fs::path/fsbridge::Path/g' $(git grep --name-only 'fs::path' -- '*.cpp' '*.h' | grep -v 'fs.h' | grep -v 'fs.cpp') sed -i 's/boost::filesystem::path/fsbridge::Path/g' $(git grep --name-only 'boost::filesystem::path' -- '*.cpp' '*.h' | grep -v 'fs.h' | grep -v 'fs.cpp') -END VERIFY SCRIPT-
Move fs::path(string) to fsbridge::U8Path(string) a492285b49ken2812221 force-pushed on May 9, 2018Read command line arguments as utf8 d37d4b283502fb8835bascripted-diff: Use `.u8string()` instead of `.string()`
-BEGIN VERIFY SCRIPT- sed -i 's/\.string()/\.u8string()/g' $(git grep --name-only '\.string()' -- '*.cpp' '*.h' | grep -v 'fs.h' | grep -v 'fs.cpp') -END VERIFY SCRIPT-
ken2812221 force-pushed on May 9, 2018ken2812221 commented at 11:59 PM on May 9, 2018: contributorSeems not possible to wrap all filesystem classes. Close it and reopen #13107
ken2812221 closed this on May 9, 2018ken2812221 deleted the branch on May 9, 2018MarcoFalke locked this on Sep 8, 2021ContributorsLabels
github-metadata-mirror
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-13 15:15 UTC
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-13 15:15 UTC
This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me
More mirrored repositories can be found on mirror.b10c.me