Issue #12652 has been updated by Shyouhei Urabe.

Status changed from Open to Assigned
Assignee set to Yui NARUSE

----------------------------------------
Bug #12652: For Dir.home encode passed user
https://bugs.ruby-lang.org/issues/12652#change-60819

* Author: Dvis Mosns
* Status: Assigned
* Priority: Normal
* Assignee: Yui NARUSE
* ruby -v: ruby 2.4.0dev (2016-08-03 trunk 55810) [x64-mswin64_140]
* Backport: 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN
----------------------------------------
Currently Dir.home(user) expects that passed user will be already in appropriate encoding but if it's not it will fail because comparing with different encodings.

This causes TestDir#test_home to fail.

~~~ruby
user = ENV['USER']
puts Dir.home(user)
~~~

fails with

~~~
`home': user Dvis doesn't exist (ArgumentError)
~~~

On Linux it will fail too if passed user is in different encoding than locale.

I've attached a patch which fixes this.



---Files--------------------------------
0001-For-Dir.home-encode-passed-user.patch (1.24 KB)


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