Fix "Not enough memory" error on Windows 7 more.com by setting code page.#4595
Merged
Fix "Not enough memory" error on Windows 7 more.com by setting code page.#4595
Conversation
schlessera
reviewed
Jan 5, 2018
php/commands/help.php
Outdated
| // For Windows 7 need to set code page to something other than Unicode (65001) to get around "Not enough memory." error with `more.com` on PHP 7.1+. | ||
| if ( 'more' === $pager && defined( 'PHP_WINDOWS_VERSION_MAJOR' ) && PHP_WINDOWS_VERSION_MAJOR < 10 && function_exists( 'sapi_windows_cp_set' ) ) { | ||
| // Note will also apply to Windows 8 (see http://msdn.microsoft.com/en-us/library/windows/desktop/ms724832.aspx) but probably harmless anyway. | ||
| sapi_windows_cp_set( 1252 ); // `sapi_windows_cp_set()` introduced PHP 7.1. Code page 1252 is the most used so probably the most compat. |
Member
There was a problem hiding this comment.
Does it make sense to pick the codepage through an overrideable ENV variable? That way, impacted users can switch if needed.
schlessera
approved these changes
Jan 5, 2018
Member
schlessera
left a comment
There was a problem hiding this comment.
Let's deploy it like this, and keep in mind that Windows 8 might be impacted as a side-effect.
In case we get reports from Windows 8 users, we can still fine-tune the targeting.
Contributor
Author
|
Cool, will merge as soon as Travis stops messing about. Might create a Windows 8 virtualbox and check it out before release if poss... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #4593
Sets code page to 1252 if on Windows < 10 and pager is
more.comand PHP >= 7.1.