From: "S. Hieko" Date: 2012-10-01T18:06:56+09:00 Subject: Windows XP - Path encoding problem prevents script execution Hello all, I've installed ruby 1.9.3 on a Windows XP box (french) for work related purposes, with ruby installer from rubyinstaller.org. (same thing happened on 1.9.2) Here is the content of a very simple script #SCRIPT_START puts "This should work, press a key to exit" gets #SCRIPT_END The script executes normally if saved to a path such as "C:\Scripts\Ok\test.rb" However if saved to a path with an accent for instance "C:\Scripts\Cliché\test.rb", I get an instant failure if I double click on the script file. Going to the command line, if I type: - C:\Scripts\Ok\test.rb => execution is ok. - C:\Scripts\Cliché\test.rb => returns following error "C:/Scripts/ClichÚ/test.rb: No such file or directory - C:/Scripts/ClichÚ (Errno::ENOENT)" - ruby C:\Scripts\Cliché\test.rb => execution is ok. This problem also causes failure if I need to use "require" pointing to other scripts. For instance if I type inside irb: require "C:\\Scripts\\Ok\\test.rb" => execution is ok require "C:\\Scripts\\Cliché\\test.rb" => failure to find file I have noticed there are many encodings being used all over the place. For instance in irb : - Dir.pwd.encoding.name returns "Windows-1252" - "test".encoding.name returns "CP850" So require "C:\\Scripts\\Cliché\\test.rb".encode("Windows-1252") seems to solve that problem. regedit HKEY_LOCAL_MACHINE\SOFTWARE\Classes\RubyFile\shell\open\command = "C:\Ruby193\bin\ruby.exe" "%1" %* So I guess the ruby interpreter is expecting the script name as a string in another encoding than that which is given by the windows subsystem. How can I solve this problem ? I would like to keep the double click functionality, without having to resort to batch file wrappers. Thanks for your input. -- Posted via http://www.ruby-forum.com/.