[LLVMdev] request for windows unicode support

Jochen Wilhelmy j.wilhelmy at arcor.de
Thu Nov 25 14:01:38 PST 2010


Hi!

Of course nobody wants to implement unicode support for windows
because windows should support an utf8-locale and windows is obsolete
anyway ;-)

But there is a simple solution: use boost::filesystem::path everywhere you
use file names and paths, for example in clang::FileManager::getFile.
With version 3 opening a file is easy: std::fstream file(path.c_str()).
Internally boost::filesystem::path uses the native encoding which is
utf16 for windows but you won't notice it since it recodes 8 bit strings
automatically (which is no-op on unix and macos).

If you don't want to become dependent on boost, I suggest reimplementing
the most important features always using 8 bit strings and then have 
something
like this:

#ifdef HAVE_BOOST
namespace fs = boost::filesystem;
#else
// simple implementation here
#endif

-Jochen




More information about the llvm-dev mailing list