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:2
Avg. Score:5.0 ± 0.0
Reproduced:2 of 2 (100.0%)
Same Version:2 (100.0%)
Same OS:1 (50.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
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
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

Pull Requests

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-2024 The PHP Group
All rights reserved.
Last updated: Sun Oct 13 15:01:29 2024 UTC