简体   繁体   English

Ruby脚本在ConEmu中打破西里尔字母

[英]Ruby script breaks Cyrillic characters in ConEmu

I have a simple Ruby script in UTF8-encoded file 01.rb: 我在UTF8编码的文件01.rb中有一个简单的Ruby脚本:

#encoding: utf-8
puts "Hello, Марина!"
gets

It works perfectly in Win7 console (cmd.exe), but when I try to run it in ConEmu, it returns: 它在Win7控制台(cmd.exe)中完美运行,但是当我尝试在ConEmu中运行它时,它返回:

$ ruby 01.rb 
Hello, Р?Р°С?РёР?Р°!

Tried to use 尝试使用

$ chcp 65001

but recieved: 但收到:

D:/Programms/Ruby/Marcia/01/01.rb:1: [BUG] rb_sys_fail_path_in(io_write, <STDOUT>) - errno == 0
ruby 2.1.6p336 (2015-04-13 revision 50298) [i386-mingw32]

-- Control frame information -----------------------------------------------
c:0005 p:---- s:0012 e:000011 CFUNC  :write
c:0004 p:---- s:0010 e:000009 CFUNC  :puts
c:0003 p:---- s:0008 e:000007 CFUNC  :puts
c:0002 p:0007 s:0004 E:0008dc EVAL   D:/Programms/Ruby/Marcia/01/01.rb:1 [FINISH]
c:0001 p:0000 s:0002 E:000884 TOP    [FINISH]

D:/Programms/Ruby/Marcia/01/01.rb:1:in `<main>'
D:/Programms/Ruby/Marcia/01/01.rb:1:in `puts'
D:/Programms/Ruby/Marcia/01/01.rb:1:in `puts'
D:/Programms/Ruby/Marcia/01/01.rb:1:in `write'

-- C level backtrace information -------------------------------------------
C:\Windows\SysWOW64\ntdll.dll(ZwWaitForSingleObject+0x15) [0x77D8F8D1]
C:\Windows\syswow64\kernel32.dll(WaitForSingleObjectEx+0x43) [0x75781194]
C:\Windows\syswow64\kernel32.dll(WaitForSingleObject+0x12) [0x75781148]
C:\Ruby21\bin\msvcrt-ruby210.dll(rb_vm_bugreport+0xa7) [0x6D388C07]
C:\Ruby21\bin\msvcrt-ruby210.dll(rb_name_err_mesg_new+0x69f) [0x6D24440F]
C:\Ruby21\bin\msvcrt-ruby210.dll(rb_bug+0x2e) [0x6D2451BE]
C:\Ruby21\bin\msvcrt-ruby210.dll(rb_syserr_fail_path_in+0x41) [0x6D246AD1]
C:\Ruby21\bin\msvcrt-ruby210.dll(rb_mod_sys_fail+0x0) [0x6D246BA0]
C:\Ruby21\bin\msvcrt-ruby210.dll(rb_io_close+0x1a81) [0x6D27A061]
C:\Ruby21\bin\msvcrt-ruby210.dll(rb_vm_localjump_error+0x64f3) [0x6D37D6F3]
C:\Ruby21\bin\msvcrt-ruby210.dll(rb_funcallv+0x7e) [0x6D3836AE]
C:\Ruby21\bin\msvcrt-ruby210.dll(rb_io_puts+0x96) [0x6D276096]
C:\Ruby21\bin\msvcrt-ruby210.dll(rb_vm_localjump_error+0x64f3) [0x6D37D6F3]
C:\Ruby21\bin\msvcrt-ruby210.dll(rb_funcallv+0x7e) [0x6D3836AE]
C:\Ruby21\bin\msvcrt-ruby210.dll(rb_io_puts+0x21c) [0x6D27621C]
C:\Ruby21\bin\msvcrt-ruby210.dll(rb_error_arity+0x1c6) [0x6D373E76]
C:\Ruby21\bin\msvcrt-ruby210.dll(rb_f_send+0x648) [0x6D37F738]
C:\Ruby21\bin\msvcrt-ruby210.dll(rb_vm_localjump_error+0x1b37) [0x6D378D37]
C:\Ruby21\bin\msvcrt-ruby210.dll(rb_vm_localjump_error+0x57b1) [0x6D37C9B1]
C:\Ruby21\bin\msvcrt-ruby210.dll(rb_iseq_eval_main+0x121) [0x6D3855C1]
C:\Ruby21\bin\msvcrt-ruby210.dll(rb_check_copyable+0x3186) [0x6D24A0A6]
C:\Ruby21\bin\msvcrt-ruby210.dll(ruby_run_node+0x2d) [0x6D24D38D]
 [0x0040287F]
 [0x004013FA]
C:\Windows\syswow64\kernel32.dll(BaseThreadInitThunk+0x12) [0x757833AA]
C:\Windows\SysWOW64\ntdll.dll(RtlInitializeExceptionChain+0x63) [0x77DA9F72]

-- Other runtime information -----------------------------------------------

* Loaded script: D:/Programms/Ruby/Marcia/01/01.rb

* Loaded features:

    0 enumerator.so
    1 C:/Ruby21/lib/ruby/2.1.0/i386-mingw32/enc/encdb.so
    2 C:/Ruby21/lib/ruby/2.1.0/i386-mingw32/enc/windows_1251.so
    3 C:/Ruby21/lib/ruby/2.1.0/i386-mingw32/enc/trans/transdb.so
    4 C:/Ruby21/lib/ruby/2.1.0/i386-mingw32/rbconfig.rb
    5 C:/Ruby21/lib/ruby/2.1.0/rubygems/compatibility.rb
    6 C:/Ruby21/lib/ruby/2.1.0/rubygems/defaults.rb
    7 C:/Ruby21/lib/ruby/2.1.0/rubygems/deprecate.rb
    8 C:/Ruby21/lib/ruby/2.1.0/rubygems/errors.rb
    9 C:/Ruby21/lib/ruby/2.1.0/rubygems/version.rb
   10 C:/Ruby21/lib/ruby/2.1.0/rubygems/requirement.rb
   11 C:/Ruby21/lib/ruby/2.1.0/rubygems/platform.rb
   12 C:/Ruby21/lib/ruby/2.1.0/rubygems/basic_specification.rb
   13 C:/Ruby21/lib/ruby/2.1.0/rubygems/stub_specification.rb
   14 C:/Ruby21/lib/ruby/2.1.0/rubygems/util/stringio.rb
   15 C:/Ruby21/lib/ruby/2.1.0/rubygems/specification.rb
   16 C:/Ruby21/lib/ruby/2.1.0/rubygems/exceptions.rb
   17 C:/Ruby21/lib/ruby/2.1.0/rubygems/defaults/operating_system.rb
   18 C:/Ruby21/lib/ruby/2.1.0/rubygems/core_ext/kernel_gem.rb
   19 thread.rb
   20 C:/Ruby21/lib/ruby/2.1.0/i386-mingw32/thread.so
   21 C:/Ruby21/lib/ruby/2.1.0/monitor.rb
   22 C:/Ruby21/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb
   23 C:/Ruby21/lib/ruby/2.1.0/rubygems.rb

[NOTE]
You may have encountered a bug in the Ruby interpreter or extension libraries.
Bug reports are welcome.
For details: http://www.ruby-lang.org/bugreport.html


This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.

Is there a way to make ConEmu behave like cmd.exe? 有没有办法让ConEmu表现得像cmd.exe?

Prooflink for standart console: http://i.stack.imgur.com/NqUdM.png http://i.imgur.com/SmMImI6.png 用于标准控制台的Prooflink: http ://i.stack.imgur.com/NqUdM.png http://i.imgur.com/SmMImI6.png

Problem with fixed in build 150814. 在版本150814中修复的问题。

way to make ConEmu behave like cmd.exe? 使ConEmu表现得像cmd.exe的方法?

What? 什么? It already behaves like cmd.exe. 它的行为已经像cmd.exe。 Regardless the fact it's not a proper declaration . 不管事实,这都不是正确的声明

Have you tried it outside of ConEmu? 您在ConEmu之外尝试过吗? And what version you are trying? 您正在尝试什么版本?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM