[cfe-dev] Unicode path handling on Windows

Jean-Daniel Dupas devlists at shadowlab.org
Thu Sep 1 00:36:44 PDT 2011


Le 31 août 2011 à 21:02, Aaron Ballman a écrit :

> On Wed, Aug 31, 2011 at 1:17 PM, Eli Friedman <eli.friedman at gmail.com> wrote:
>> On Wed, Aug 31, 2011 at 10:58 AM, Nikola Smiljanic <popizdeh at gmail.com> wrote:
>>> _wopen expects wchar_t* and the only visible function for conversion to
>>> utf16 is ConvertUTF8toUTF32 which converts to unsigned shorts.
>> 
>> If you're in #ifdef WIN32 code, just use ConvertUTF8toUTF16 and
>> reinterpret_cast from unsigned short* to wchar_t*.
> 
> I think the problem is that PathV2.inc is part of LLVM, and the
> ConvertUTF8ToUTF16 function is in an anonymous namespace.  So the
> question becomes: raise the function into an accessible namespace,
> duplicate code, or find some other mechanism?

This function is also available in clang/lib/Basic/ConvertUTF.c

> 
> I don't think it makes sense to raise the function out of the
> anonymous namespace unless it's also moved (it has nothing to do with
> paths per se).  Perhaps it's worth it to move it to StringRef?
> 
> ~Aaron
> 
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev

-- Jean-Daniel








More information about the cfe-dev mailing list