[LLVMdev] [cfe-dev] LLVM & Clang file management

Nikola Smiljanic popizdeh at gmail.com
Mon Jan 23 01:03:06 PST 2012


AFAIK Clang assumes that everything that comes from the command line is
UTF8 encoded.

On Tue, Jan 17, 2012 at 4:28 PM, Manuel Klimek <klimek at google.com> wrote:

> On Sat, Dec 24, 2011 at 9:52 AM, Nikola Smiljanic <popizdeh at gmail.com>
> wrote:
> >
> > On Tue, Dec 6, 2011 at 11:27 AM, Manuel Klimek <klimek at google.com>
> wrote:
> >>
> >>
> >> Are there open bugs? A quick search for unicode on llvm.org/bugs
> >> didn't show anything windows specific.
> >>
> >
> > There's http://llvm.org/bugs/show_bug.cgi?id=10348
> >
> > I've been trying to fix it but can't get anyone to review the patches
> (Aaron
> > Ballman did a review but he doesn't have commit access). The problem is
> that
> > ::stat function can't handle UTF8 paths on Windows. My solution was to
> get
> > the command line arguments as UTF16 and convert them to UTF8 and then
> > convert them back to UTF16 before calling ::_wstat. The problem is that
> stat
> > structure is used throughout the code base, and ::_wstat has different
> > parameter type. This solution is far from perfect. It seems to me that
> what
> > you're discussing would solve this issue in a more general way (maybe
> even
> > fix all the mess with struct stat *StatBuf being passed around)?
>
> Thanks a lot for the pointer. Why did you need to convert the file
> names to UTF8 instead of just leaving them as UTF16 throughout the app
> and using wstat everywhere? Are there places in clang that assume a
> certain encoding of file names?
>
> Cheers,
> /Manuel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20120123/85308726/attachment.html>


More information about the llvm-dev mailing list