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

E0d8c2f6e65b6fce72a5c20da9d7adbe?d=identicon&s=25 chandan mallik (chandan0707)
on 2013-03-22 10:59
File.exist? in not working with directory name having special
characters. for something like given below
path =
"/home/cis/Desktop/'El%20POP%20que%20llevas%20dentro%20Vol.%202'/*.mp3"

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

#encode: utf-8

 ...in 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.
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.