Article ID: 115747, created on Mar 19, 2013, last review on May 4, 2014

  • Applies to:
  • Operations Automation
  • APS


Non-ascii characters are malformed when PHP configuration script of External APS application is run on Windows provisioning gateway.

For example, BackupAgent script fails with the following error message:
SOAP-ERROR: Encoding: string 'S+\xfa...' is not a valid utf-8 string
The 'City' field was São Paulo, and non-ascii symbol was broken.


Windows has 2 code pages: ACP (HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Nls\CodePage\ACP) and OEMCP (MS DOS code page,  HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Nls\CodePage\OEMCP).

By default, they are different.

Settings are passed to PHP script via Windows batch script, which uses OEMCP codepage, while php.exe interpreter uses ACP, so there is encoding conflict.

Problem does not occur if configuration script is vbscript or jscript instead of PHP.


To fix the problem,  set OEMCP to the same value as ACP.

Change OEMCP in registry (HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Nls\CodePage) and reboot node.

717db81efe94e616312b74fb03a5d474 5356b422f65bdad1c3e9edca5d74a1ae caea8340e2d186a540518d08602aa065 e12cea1d47a3125d335d68e6d4e15e07

Email subscription for changes to this article
Save as PDF