[llvm] r329468 - Windows needs the current codepage instead of utf8 sometimes

Aaron Smith via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 6 18:12:45 PDT 2018


Hi Eli,

Yes that is unfortunate. The testing infrastructure is very delicate when it comes to encoding and python versions. See https://reviews.llvm.org/D43165 for more discussion. If you have other ideas, please let us know.

Aaron 

On 4/6/18, 6:08 PM, "Friedman, Eli" <efriedma at codeaurora.org> wrote:

    On 4/6/2018 5:32 PM, Aaron Smith via llvm-commits wrote:
    > Author: asmith
    > Date: Fri Apr  6 17:32:59 2018
    > New Revision: 329468
    >
    > -  // Just use the caller's original path.
    > -  return UTF8ToUTF16(Path8Str, Path16);
    > +  // Path8Str now contains the full path or the original path
    > +  // If the conversion from UTF8 to UTF16 fails because of ERROR_NO_UNICODE_TRANSLATION,
    > +  // we also try using the current code page before giving up
    > +  auto ec = UTF8ToUTF16(Path8Str, Path16);
    > +  if (ec == mapWindowsError(ERROR_NO_UNICODE_TRANSLATION)) {
    > +    ec = CurCPToUTF16(Path8Str, Path16);
    > +  }
    > +  return ec;
    
    This change is really dubious: we should not be charset sniffing in a 
    compiler.  This will cause bugs where code appears to work sometimes, 
    but randomly breaks when we guess the encoding incorrectly.
    
    -Eli
    
    -- 
    Employee of Qualcomm Innovation Center, Inc.
    Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project
    
    



More information about the llvm-commits mailing list