[cmake-developers] [PATCH v4 4/4] For Windows encode process output to internally used encoding

Dāvis Mosāns davispuh at gmail.com
Tue Aug 2 16:04:48 EDT 2016


2016-08-02 20:11 GMT+03:00 Brad King <brad.king at kitware.com>:
>
> How are we to know the encoding being produced by the child?
>

There isn't any reliable way to detect it, we just have to know what particular
application uses. Also there aren't any standard or API to determine it but
generally most applications use console's code page. Of course not all, it
could be OEM, ANSI or something else.

If application uses console's code page for pipes then app.exe | echo will
output correctly in cmd and piping in other application which also uses
it will work.

Here our issue is that when CMake checks for compiler path it gets output
from MSVC and it will give this path in console's codepage which will be
incorrectly interpreted as UTF-8 so we need to decode it first.

If there will some other application which uses different encoding then it will
need separate handling for that.


More information about the cmake-developers mailing list