[LLVMdev] request for windows unicode support

Michael Spencer bigcheesegs at gmail.com
Fri Nov 26 06:28:17 PST 2010


On Fri, Nov 26, 2010 at 4:00 AM, Jochen Wilhelmy <j.wilhelmy at arcor.de> wrote:
> No, this post was prompted since I switched to boost::filesystem version 3
> in my own code and llvm/clang 2.8
> was the only lib with no unicode support on windows.
> Will your code be api compatible to boost::filesystem?

No. boost::filesystem makes extensive use of exceptions, which LLVM is
compiled without, and it does a lot of string allocation and copying.

> The reason for this
> is that maybe boost::filesystem
> will become part of the standard and it is possible to imbue() a locale on
> boost::filesystem.
> While this feature is not needed on unix/macos it gives you global control
> whether you want to use ansi or
> unicode on windows.
> If you implement your own code with always utf-8 this may break
> compatibility with windows ansi
> encoding if you don't take care and why reinvent the wheel? maybe you could
> even copy/paste the
> boost implementation and use the #ifdef HAVE_BOOST approach.
>
> -Jochen

The conversion only has to be written once. And while I do like the
way boost::filesystem handles locale issues, the API is not suited for
LLVM for the above reasons. However, if you have a better design than
what I proposed, I'd love to see it. I'm not that familiar with
dealing with Unicode under Windows.

- Michael Spencer



More information about the llvm-dev mailing list