Issue #12127 has been updated by Martin Drst.

Status changed from Open to Feedback

Can you explain what the problem is with

$ LANG=en_US.utf-8 ruby -e "puts ''.encoding"
US-ASCII

As far as I understand, strings with an encoding of US-ASCII can be used wherever an UTF-8 string can be used, so this shouldn't create any new errors.

----------------------------------------
Bug #12127: LANG environment is not respected
https://bugs.ruby-lang.org/issues/12127#change-57226

* Author: Vit Ondruch
* Status: Feedback
* Priority: Normal
* Assignee: 
* ruby -v: 
* Backport: 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN
----------------------------------------
Ruby 2.2:

~~~
$ ruby -v
ruby 2.2.4p230 (2015-12-16 revision 53155) [x86_64-linux]

$ ruby -e "puts ''.encoding"
US-ASCII

$ LANG=en_US.utf-8 ruby -e "puts ''.encoding"
UTF-8
~~~


Ruby 2.3:

~~~
$ ruby -v
ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-linux]

$ ruby -e "puts ''.encoding"
US-ASCII

$ LANG=en_US.utf-8 ruby -e "puts ''.encoding"
US-ASCII
~~~




-- 
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>