On 07/21/2016 08:43 PM, Dāvis Mosāns wrote:
> With MultiByteToWideChar such partial char would be replaced with ? (U+003F)
> or � (U+FFFD).
[snip]
> Also could check if last character is ? and try again with one byte less.

This may be a good middle ground.  The excess bytes would then be buffered
for inclusion at the beginning of the next block conversion.

How are we to know the encoding being produced by the child?

> from WaitForData we're getting data and length, and I assume that data
> might not be null-terminated but kwsysEncoding_mbstowcs expects source to be
> null-terminated and doesn't accept length.

Okay, thanks.  Using MultiByteToWideChar for Windows-specific code is
fine.  If we ever need to offer a similar generalization then we can
provide a kwsysEncoding_mbsnrtowcs later.

BTW, with all your changes to KWSys it may be easier to iterate
if you contribute to KWSys directly.  Please see instructions here:

 http://public.kitware.com/Wiki/KWSys/Git/Develop

Thanks,
-Brad
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers

Reply via email to