You are viewing the version of this documentation from Perl 5.41.7. This is a development version of Perl.
${^ENCODING}

This variable is no longer supported.

It used to hold the object reference to the Encode object that was used to convert the source code to Unicode.

Its purpose was to allow your non-ASCII Perl scripts not to have to be written in UTF-8; this was useful before editors that worked on UTF-8 encoded text were common, but that was long ago. It caused problems, such as affecting the operation of other modules that weren't expecting it, causing general mayhem.

If you need something like this functionality, it is recommended that use you a simple source filter, such as Filter::Encoding.

If you are coming here because code of yours is being adversely affected by someone's use of this variable, you can usually work around it by doing this:

local ${^ENCODING};

near the beginning of the functions that are getting broken. This undefines the variable during the scope of execution of the including function.

This variable was added in Perl 5.8.2 and removed in 5.26.0. Setting it to anything other than undef was made fatal in Perl 5.28.0.