[llvm] r190423 - Add getenv() wrapper that works on multibyte environment variable.

罗勇刚(Yonggang Luo) luoyonggang at gmail.com
Tue Sep 10 18:11:39 PDT 2013


在 2013年9月11日 上午5:49,"Eli Friedman" <eli.friedman at gmail.com>写道:
>
> Given a valid source string, both conversion routines will generate the
same result: the rules are defined in the Unicode standard.

+1 for this, there is no need add windows specified Unicode convert
functions to add duplicated code.
>
> -Eli
>
>
>
> On Tue, Sep 10, 2013 at 2:43 PM, Rui Ueyama <ruiu at google.com> wrote:
>>
>> Also what I'm not very sure if that the conversion result of Windows
MultiByteToWideChar/WideCharToMultiByte is always the same as LLVM's
conversion routine's result. These should be always the same but there
could be ambiguity there.
>>
>>
>> On Tue, Sep 10, 2013 at 2:38 PM, Reid Kleckner <rnk at google.com> wrote:
>>>
>>> On Tue, Sep 10, 2013 at 5:31 PM, Eli Friedman <eli.friedman at gmail.com>
wrote:
>>>>
>>>> On Tue, Sep 10, 2013 at 12:45 PM, Rui Ueyama <ruiu at google.com> wrote:
>>>>>
>>>>> +namespace sys {
>>>>> +namespace windows {
>>>>> +error_code UTF8ToUTF16(StringRef utf8,
>>>>> +                       SmallVectorImpl<wchar_t> &utf16);
>>>>> +error_code UTF16ToUTF8(const wchar_t *utf16, size_t utf16_len,
>>>>> +                       SmallVectorImpl<char> &utf8);
>>>>> +} // end namespace windows
>>>>> +} // end namespace sys
>>>>>  } // end namespace llvm.>
>>>>>
>>>>> We already have include/llvm/Support/ConvertUTF.h; we shouldn't need
Windows-specific version.
>>>
>>>
>>> We don't have a wrapper equivalent to UTF8ToUTF16, and I didn't think
it was worth adding one that would only be called on Windows.
>>>
>>> Only the Windows Path wrappers really need to produce UTF16, so it
makes sense to me that they hold the functionality.
>>
>>
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130911/88f7bb6d/attachment.html>


More information about the llvm-commits mailing list