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

2016-08-02 Thread Dāvis Mosāns
2016-08-02 20:11 GMT+03:00 Brad King : > > 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

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

2016-08-02 Thread Brad King
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

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

2016-07-21 Thread Dāvis Mosāns
2016-07-21 20:46 GMT+03:00 Brad King : > On 07/21/2016 01:36 PM, Dāvis Mosāns wrote: >> Anyway I improved this in places where it was easy, but in some places it's >> more complicated... >> >> For example >> >>while ((p = cmsysProcess_WaitForData(cp, , , CM_NULLPTR), p))

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

2016-07-21 Thread Brad King
On 07/21/2016 01:36 PM, Dāvis Mosāns wrote: > Anyway I improved this in places where it was easy, but in some places it's > more complicated... > > For example > >while ((p = cmsysProcess_WaitForData(cp, , , CM_NULLPTR), p)) { > // Put the output in the right place. > if (p ==

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

2016-07-21 Thread Dāvis Mosāns
2016-07-18 17:04 GMT+03:00 Brad King : > On 07/07/2016 05:54 PM, Dāvis Mosāns wrote: >> Typically Windows applications (eg. MSVC compiler) use current console's >> codepage for output to pipes so we need to encode that to internally used >> encoding

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

2016-07-18 Thread Brad King
On 07/07/2016 05:54 PM, Dāvis Mosāns wrote: > Typically Windows applications (eg. MSVC compiler) use current console's > codepage for output to pipes so we need to encode that to internally used > encoding (KWSYS_ENCODING_DEFAULT_CODEPAGE). [snip] >while ((p = cmsysProcess_WaitForData(cp, , ,

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

2016-07-07 Thread Dāvis Mosāns
Typically Windows applications (eg. MSVC compiler) use current console's codepage for output to pipes so we need to encode that to internally used encoding (KWSYS_ENCODING_DEFAULT_CODEPAGE). --- Source/cmExecProgramCommand.cxx| 1 + Source/cmExecuteProcessCommand.cxx | 1 +