<p dir="ltr"><br>
在 2013年9月11日 上午5:49,"Eli Friedman" <<a href="mailto:eli.friedman@gmail.com">eli.friedman@gmail.com</a>>写道:<br>
><br>
> Given a valid source string, both conversion routines will generate the same result: the rules are defined in the Unicode standard.</p>
<p dir="ltr">+1 for this, there is no need add windows specified Unicode convert functions to add duplicated code.<br>
><br>
> -Eli<br>
><br>
><br>
><br>
> On Tue, Sep 10, 2013 at 2:43 PM, Rui Ueyama <<a href="mailto:ruiu@google.com">ruiu@google.com</a>> wrote:<br>
>><br>
>> 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.<br>

>><br>
>><br>
>> On Tue, Sep 10, 2013 at 2:38 PM, Reid Kleckner <<a href="mailto:rnk@google.com">rnk@google.com</a>> wrote:<br>
>>><br>
>>> On Tue, Sep 10, 2013 at 5:31 PM, Eli Friedman <<a href="mailto:eli.friedman@gmail.com">eli.friedman@gmail.com</a>> wrote:<br>
>>>><br>
>>>> On Tue, Sep 10, 2013 at 12:45 PM, Rui Ueyama <<a href="mailto:ruiu@google.com">ruiu@google.com</a>> wrote:<br>
>>>>><br>
>>>>> +namespace sys {<br>
>>>>> +namespace windows {<br>
>>>>> +error_code UTF8ToUTF16(StringRef utf8,<br>
>>>>> +                       SmallVectorImpl<wchar_t> &utf16);<br>
>>>>> +error_code UTF16ToUTF8(const wchar_t *utf16, size_t utf16_len,<br>
>>>>> +                       SmallVectorImpl<char> &utf8);<br>
>>>>> +} // end namespace windows<br>
>>>>> +} // end namespace sys<br>
>>>>>  } // end namespace llvm.><br>
>>>>><br>
>>>>> We already have include/llvm/Support/ConvertUTF.h; we shouldn't need Windows-specific version.<br>
>>><br>
>>><br>
>>> 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.<br>
>>><br>
>>> Only the Windows Path wrappers really need to produce UTF16, so it makes sense to me that they hold the functionality.<br>
>><br>
>><br>
><br>
><br>
> _______________________________________________<br>
> llvm-commits mailing list<br>
> <a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
><br>
</p>