[fpc-pascal] Executing external processes and codepages

Michael Van Canneyt michael at freepascal.org
Wed May 11 13:41:18 CEST 2016



On Wed, 11 May 2016, Jonas Maebe wrote:

>
> Michael Van Canneyt wrote on Wed, 11 May 2016:
>
>> On Wed, 11 May 2016, Jonas Maebe wrote:
>> 
>>> 
>>> Michael Van Canneyt wrote on Wed, 11 May 2016:
>>> 
>>>> And in the case it makes an assumption of the code page, regardless of
>>>> environment variables ?
>>>> 
>>>> (don't say that doesn't happen. It does, I know a programmer that does 
>>>> so)
>>> 
>>> The caller can work around such bugs by either
>>> a) using the pchar version of fpexec, or
>>> b) specifying the code page that this target program uses in the 
>>> environment used to invoke it
>> 
>> a) obviously
>> b) As said, the target program completely ignores the environment.
>
> b) is exactly why you have to specify the code page that this *target 
> program* uses in the environment when executing it, so that the invoking FPC 
> program will convert the parameters to this code page.

You are now assuming that this is possible. This may not be the case.

>> I was just trying to point out that while your solution is undoubtedly 
>> correct
>> in the large majority of cases (let's assume 99,99%), it is not a rock-hard 
>> guarantee.
>
> I never claimed it was. I only said it is the only possible correct 
> behaviour.

We clearly have different understandings of the words 'correct behaviour' then :-)

Michael.



More information about the fpc-pascal mailing list