简体   繁体   中英

ICU UnicodeString to Locale Encoding

As I understand it, Boost.Filesystem uses the native locale encoding, and I use ICU's UnicodeString instead of std::string as it works for Unicode. However, I want to convert my UnicodeString to some kind of std::string of the native locale ending. How would I do this? I'd like to avoid using C strings.

I think this gives the answers your looking for:

Conversions to native format

If tl;dr:

boost::filesystem::path p;
// ...
std::string native = p.string();

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM