Issue #14077 has been reported by nirvdrum (Kevin Menard).

----------------------------------------
Feature #14077: Add Encoding::FILESYSTEM and Encoding::LOCALE constants
https://bugs.ruby-lang.org/issues/14077

* Author: nirvdrum (Kevin Menard)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
----------------------------------------
The `Encoding` class has constants defined for all of the standard encodings, but does not have constants defined for some of the special encodings. In particular, the "filesystem" and "locale" encodings do not have a corresponding `Encoding::FILESYSTEM` and `Encoding::LOCALE`. As a result, every time they need to be used they must be looked up using `Encoding.find`. As far as I can tell, neither of these special encodings can change after the Ruby process has been started up. Even changing the `$LANG` environment variable within the Ruby process doesn't seem to affect the value for these special encodings.

Therefore, I'm proposing the introduction of `Encoding::FILESYSTEM` and `Encoding::LOCALE` constants both as a matter of consistency and as a matter of efficiency.




-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>