[cfe-dev] Unicode path handling on Windows

Nikola Smiljanic popizdeh at gmail.com
Thu Sep 1 02:44:35 PDT 2011


The function available in clang/lib/Basic/ConvertUTF.c deals with unsigned
shorts, and I need wchar_t?

On Thu, Sep 1, 2011 at 9:36 AM, Jean-Daniel Dupas <devlists at shadowlab.org>wrote:

>
> 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
>
>
>
>
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20110901/a9b182f5/attachment.html>


More information about the cfe-dev mailing list