filesystem
filesystem copied to clipboard
More Code convertion support
I am using ghc::filesystem on windows 10. I just can't construct ghc::filesystem::path with std::string in GBK encoding that is my encoding in locale. Because ghc::filesystem::path assumes std::string all in utf-8 encoding. Can you support codecvt in ghc::fileysystem::path constructor.
template <class Source, typename> inline path::path(const Source& source, format fmt) #ifdef GHC_USE_WCHAR_T : _path(detail::toWChar(source)) #else : _path(detail::toUtf8(source)) #endif { postprocess_path_with_format(fmt); }
template <typename strT, typename std::enable_if<path::_is_basic_string<strT>::value && (sizeof(typename strT::value_type) == 1), bool>::type = false> inline std::wstring toWChar(const strT& unicodeString) { return fromUtf8<std::wstring>(unicodeString); }
Maybe add another constructor
template<typename Source, typename CodeCvt> path(const Source &source, const CodeCvt &codeCvt, format format)
And I am considering using boost::filesystem instead.
I'm sorry, ghc::filesystem really is Unicode-centric utf8-everywhere motivated and documented as such. I don't have the resources to test for all the non-Unicode setups out there, as it is a single-dev project in my free time, and making changes I can't test to work is problematic for me.
Thank you for your reply. I admire your wonderful work and your choice is right. I am using boost::filesystem instead. Please close the issue.