php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #80841 Warning if default_charset is set to windows-1256
Submitted: 2021-03-06 19:42 UTC Modified: 2021-03-08 13:03 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:0 (0.0%)
From: muhannad17 at gmail dot com Assigned:
Status: Open Package: PHP options/info functions
PHP Version: 8.0.3 OS: Windows
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: muhannad17 at gmail dot com
New email:
PHP Version: OS:

 

 [2021-03-06 19:42 UTC] muhannad17 at gmail dot com
Description:
------------
When you try to set the default_charset ini setting to "Windows-1256" dynamically inside a php script a warning will show as the following :

Warning: ini_set(): Unknown encoding "windows-1256" in ini setting in *.php on line *

Warning: ini_set(): INI setting contains invalid encoding "windows-1256" in *.php on line *

The (default_charset) setting is set without any issues and the page renders in "windows-1256" without any encoding issues except the warnings.

This bug is only appears in PHP 8. PHP 7.4 doesn't have this issue.

Test script:
---------------
ini_set("default_charset","windows-1256");

Expected result:
----------------
No Warnings,


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2021-03-08 13:03 UTC] cmb@php.net
-Type: Bug +Type: Documentation Problem -Package: *General Issues +Package: PHP options/info functions
 [2021-03-08 13:03 UTC] cmb@php.net
Raising a warning in case of an unsupported encoding is a
deliberate change[1].  It might be worthwhile to document that.

[1] <https://github.com/php/php-src/commit/481b7421f3dc2f2706e54dc1b8d4701960fde4aa>
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Fri Oct 15 21:03:43 2021 UTC