1.2.1411. Utf8 Encode And Decode Are Deprecated

utf8_encode() and utf8_decode() are deprecated in PHP 8.0. They are planned removal in PHP 9.0.

See also PHP RFC: Deprecate and Remove utf8_encode and utf8_decode.

1.2.1411.1. Suggestions

  • Use mbstring functions : mb_convert_encoding($latin1, ‘UTF-8’, ‘ISO-8859-1’)

  • Use iconv functions : mb_convert_encoding($latin1, ‘UTF-8’, ‘ISO-8859-1’)

  • Use intl functions : iconv(‘ISO-8859-1’, ‘UTF-8’, $latin1)

1.2.1411.2. Specs

Short name

Php/Utf8EncodeDeprecated

Rulesets

All, CompatibilityPHP82

Exakat since

2.4.5

PHP Version

With PHP 8.2 and more recent

Severity

Minor

Time To Fix

Quick (30 mins)

Precision

Very high

Available in

Entreprise Edition, Exakat Cloud