Skip to content
This repository has been archived by the owner on Jan 8, 2021. It is now read-only.

iconv_set_encoding deprecated in PHP 5.6.0 #43

Closed
wants to merge 7 commits into from
Closed

iconv_set_encoding deprecated in PHP 5.6.0 #43

wants to merge 7 commits into from

Conversation

fisharebest
Copy link
Contributor

In PHP 5.6.0, I have not set a value for iconv.xxxxx_encoding in php.ini. php -i shows:

Directive => Local Value => Master Value
iconv.input_encoding => no value => no value
iconv.internal_encoding => no value => no value
iconv.output_encoding => no value => no value

If no value is set, then the value of ini_get('default_charset') is used.
See http://php.net/manual/en/migration56.deprecated.php

But if I attempt to get the values, I get utf-8 (lower case).

$ php -r "echo iconv_get_encoding('input_encoding');"
utf-8

As a result the function initConv() sees that utf-8 is not equal to UTF-8, and attempts to set the value. This causes a PHP_DEPRECATED error.

@nicolas-grekas
Copy link
Contributor

Closed via b16b9ab
Thanks you @fisharebest

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants