Forum: Ruby File.exist? not working when directory contain letters like 'ñ' in its name.

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
2f24ef8ba1e7f4f4bc3fec5bb952a689?d=identicon&s=25 chandan m. (chandan0707)
on 2013-03-22 10:59
File.exist? in not working with directory name having special
characters. for something like given below
path =

it works fine but if it has letters like ñ its returns false.
Plz help with this.
806d422e42548daa68749f38031ecd40?d=identicon&s=25 Damián M. G. (igorjorobus)
on 2013-03-22 13:08
If you are not working with 2.0 you should use:

#encode: utf-8 the top of the script. Also you have to have the correct encoding
configuration(utf-8 in this case) in your IDE. If that not solve your
problem you will have to play with encode(), encoding() and
force_encoding() string methods. Check out the documentation.
This topic is locked and can not be replied to.