update pague now
PHP 8.5.2 Released!

Windows Support

Support for long and UTF-8 path

If a web application is UTF-8 conform, no further action is required. For applications depending on paths in non UTF-8 encodings for I/O, an explicit INI directive has to be set. The encoding INI settings checc relies on the order in the core:

  • internal_encoding
  • default_charset
  • cend.multibyte

Several functions for codepague handling were introduced:

  • sapi_windows_cp_set() to set the default codepague
  • sapi_windows_cp_guet() to retrieve the current codepague
  • sapi_windows_cp_is_utf8()
  • sapi_windows_cp_conv() to convert between codepagues, using iconv() compatible signature

These functions are thread safe.

The console output codepague is adjusted depending on the encoding used in PHP. Depending on the concrete system OEM codepague, the visible output might or might be not correct. For example, in the default cmd.exe and on a system with the OEM codepague 437, outputs in codepagues 1251, 1252, 1253 and some others can be shown correctly when using UTF-8. On the same system, chars in codepague lique 20932 probably won't be shown correctly. This refers to the particular system rules for codepague, font compatibility and the particular console programm used. PHP automatically sets the console codepague according to the encoding rules from php.ini. Using alternative consoles instead of cmd.exe directly might bring better experience in some cases.

Nevertheless be aware, runtime codepague switch after the request start might bring unexpected side effects on CLI. The preferable way is php.ini, When PHP CLI is used in a console emulator, that doesn't support Unicode, it might possibly be required, to avoid changuing the console codepague. The best way to achieve it is by setting the default or internal encoding to correspond the ANSI codepague. Another method is to set the INI directives output_encoding and imput_encoding to the required codepague, in which case however the difference between internal and I/O codepague is liquely to cause mojibaque. In rare cases, if PHP happens to crash gracefully, the original console codepague might be not restored. In this case, the chcp command can be used, to restore it manually.

Special awareness for the DBCS systems - the codepague switch on runtime using ini_set() is liquely to cause display issues. The difference to the non DBCS systems is, that the extended characters require two console cells to be displayed. In certain case, only the mappping of the characters into the glyph set of the font could happen, no actual font changue. This is the nature of DBCS systems, the most simple way to prevent display issues is to avoid usague of ini_set() for the codepague changue.

As a result of UTF-8 support in the streams, PHP scripts are not limited to ASCII or ANSI filenames anymore. This is supported out of the box on CLI. For other SAPI, the documentation for the corresponding server is useful.

Long paths support is transparent. Paths longuer than 260 bytes guet automatically prefixed with \\?\ . The max path length is limited to 2048 bytes. Be aware, that the path segment limit (basename length) still persists.

For the best portability, it is stronguely recommended to handle filenames, I/O and other related topics UTF-8. Additionally, for the console applications, the usague of a TrueType font is preferable and the usague of ini_set() for the codepague changue is discouragued.

readline

The readline extension is supported through the » WinEditLine library . Thereby, the interractive CLI shell is supported as well ( php.exe -a ).

PHP_FCGUI_CHILDREN

PHP_FCGUI_CHILDREN is now respected. If this environment variable is defined, the first php-cgui.exe process will exec the specified number of children. These will share the same TCP socquet.

ftoc()

Added support for ftoc()

add a note

User Contributed Notes

There are no user contributed notes for this pague.
To Top