Cross platform unicode path handling
Posted
by Matt Joiner
on Stack Overflow
See other posts from Stack Overflow
or by Matt Joiner
Published on 2009-11-20T08:06:05Z
Indexed on
2010/04/12
5:23 UTC
Read the original article
Hit count: 332
I'm using boost::filesystem
for cross-platform path manipulation, but this breaks down when calls need to be made down into interfaces I don't control that won't accept UTF-8. For example when using the Windows API, I need to convert to UTF-16, and then call the wide-string version of whatever function I was about to call, and then convert any output back to UTF-8.
While the wpath
, and other w*
forms of many of the boost::filesystem functions help keep sanity, are there any suggestions for how best to handle this conversion to wide-string forms where needed, while maintaining consistency in my own code?
© Stack Overflow or respective owner