Prev: Odd Issue With DBD::SQLite3 - Inserts Don't Work
Next: [ANN] Erubis 2.6.6 released - a bug fix release
From: Jian Lin on 26 Jun 2010 22:29 Can Ruby 1.9.1 finally get a list of filenames if the filenames have unicode characters on Windows? I think back in the Ruby 1.8.6 and 1.8.7 days, that wasn't possible on Windows. -- Posted via http://www.ruby-forum.com/.
From: Bill Kelly on 27 Jun 2010 05:32 Jian Lin wrote: > Can Ruby 1.9.1 finally get a list of filenames if the filenames have > unicode characters on Windows? 1.9.1 can't, but 1.9.2 is much improved. The situation is covered in some detail here: http://redmine.ruby-lang.org/issues/show/1685 But essentially: utf8_result = Dir.entries(path, :encoding => "UTF-8") Regards, Bill
From: Jian Lin on 27 Jun 2010 08:28
Bill Kelly wrote: > Jian Lin wrote: >> Can Ruby 1.9.1 finally get a list of filenames if the filenames have >> unicode characters on Windows? > > 1.9.1 can't, but 1.9.2 is much improved. > > The situation is covered in some detail here: > > http://redmine.ruby-lang.org/issues/show/1685 > > > But essentially: > > utf8_result = Dir.entries(path, :encoding => "UTF-8") > > > Regards, > > Bill thanks. true that on Mac OS X and Linux, it has long been possible? i know somebody was using `cmd /U /C dir /B` to simulate it on Windows... but Ruby 1.8.7 behaves better with it. Ruby 1.9.1 changes 0x0a to 0x0d and messed up the UTF-16 -- Posted via http://www.ruby-forum.com/. |