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 Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
3 + 5 = ?
Subscribe to this entry?

 
 [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-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 26 02:01:29 2024 UTC