I''ve done a few changes in win32console. It uses Iconv and it works (limited) under Ruby 1.9.1 now (I haven''t tested Ruby 1.8). http://github.com/deepj/win32console/tree/master But I''ve met this following problem. When you have ruby script in utf-8 and it contains chars which doesn''t contain OEM encoding (for example cp852 vs greek cyrilic) so it doesn''t work (it''s clear). The console is possibly switched to utf-8 but I don''t know where in code :(. Another problem is PowerShell :(
On Sun, Apr 12, 2009 at 8:32 AM, deepj <deepjungle.maca at gmail.com> wrote:> I''ve done a few changes in win32console. It uses Iconv and it works > (limited) under Ruby 1.9.1 now (I haven''t tested Ruby 1.8). > > http://github.com/deepj/win32console/tree/master > > But I''ve met this following problem. When you have ruby script in utf-8 and > it contains chars which doesn''t contain OEM encoding (for example cp852 vs > greek cyrilic) so it doesn''t work (it''s clear). The console is possibly > switched to utf-8 but I don''t know where in code :(. >The ANSI.rb need to be in UTF-8, first line of the file: # encoding: utf-8 I''ll take a look to the different page encoding combination. Do you have a cyrilic file that I can binary read and send to Win32Console?> Another problem is PowerShell :(Well, one step at a time ;-)> _______________________________________________ > Rubyinstaller-devel mailing list > Rubyinstaller-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/rubyinstaller-devel >-- Luis Lavena AREA 17 - Perfection in design is achieved not when there is nothing more to add, but rather when there is nothing more to take away. Antoine de Saint-Exup?ry
The problem is in the encoding of the console''s output. The default encoding is CP852 on Czech Windows. This encoding doesn''t contain any greek cyrilic chars. Unsupported chars are removed in my patched version of win32console using this: http://is.gd/s4dX I had to done it because I don''t know how to switch the console to utf-8 output. > The ANSI.rb need to be in UTF-8, first line of the file: > # encoding: utf-8 So this is unhelpful. When I needed switch the console to utf-8 output I used this way in the C# without any problems: http://www.codeproject.com/KB/cpp/unicode_console_output.aspx> I''ll take a look to the different page encoding combination. Do you > have a cyrilic file that I can binary read and send to Win32Console?This is my test''s file: http://pastie.org/444394 Result: http://www.deep-jungle.eu/iconv.png> Well, one step at a time ;-)I hope as soon as possible :)>> _______________________________________________ >> Rubyinstaller-devel mailing list >> Rubyinstaller-devel at rubyforge.org >> http://rubyforge.org/mailman/listinfo/rubyinstaller-devel >> > > >