从Php调用Msbuild-错误的代码页和区域性

从Php调用Msbuild-错误的代码页和区域性,php,msbuild,character-encoding,Php,Msbuild,Character Encoding,我有一个通过系统调用Msbuild的Php脚本: <?php system( "msbuild umlaut.proj" ); ?> 看起来php脚本没有传入shell传入的一些环境变量。您需要使用putenv手动设置它们: bool putenv ( string $setting ); 在调用系统之前,将它们从shell复制并粘贴到脚本中。这也是我的想法。因此,我使用/verbosity:diag运行了msbuild,其中列出了包括环境变量在内的所有属性。两个列表是相同

我有一个通过系统调用Msbuild的Php脚本:

<?php
system( "msbuild umlaut.proj" );
?>

看起来php脚本没有传入shell传入的一些环境变量。您需要使用putenv手动设置它们:

bool putenv  (  string $setting  );

在调用系统之前,将它们从shell复制并粘贴到脚本中。

这也是我的想法。因此,我使用/verbosity:diag运行了msbuild,其中列出了包括环境变量在内的所有属性。两个列表是相同的。
C:\>chcp
Aktive Codepage: 1252.

C:\>msbuild umlaut.proj
Microsoft (R)-Buildmodul, Version 3.5.30729.1
[Microsoft .NET Framework, Version 2.0.50727.3607]
Copyright (C) Microsoft Corporation 2007. Alle Rechte vorbehalten.

Das Erstellen wurde am 13.04.2010 08:57:04 gestartet.
Projekt "D:\Cvsroot\projekte\e4elaui\v1.0\umlaut.proj" auf Knoten 0 (Standardziele).
  Umlaute: Ä Ö Ü ä ö ü ß
Die Erstellung von Projekt "D:\Cvsroot\projekte\e4elaui\v1.0\umlaut.proj" ist abgeschlossen (Standardziele).


Das Erstellen war erfolgreich.
    0 Warnung(en)
    0 Fehler

Vergangene Zeit 00:00:00

C:\>php call_from_php.php
Microsoft (R) Build Engine Version 3.5.30729.1
[Microsoft .NET Framework, Version 2.0.50727.3607]
Copyright (C) Microsoft Corporation 2007. All rights reserved.

Build started 13.04.2010 08:57:11.
Project "D:\Cvsroot\projekte\e4elaui\v1.0\umlaut.proj" on node 0 (default targets).
  Umlaute: Ž ™ š „ ”  á
Done Building Project "D:\Cvsroot\projekte\e4elaui\v1.0\umlaut.proj" (default targets).

Build succeeded.
    0 Warning(s)
    0 Error(s)

Time Elapsed 00:00:00
bool putenv  (  string $setting  );