enter image description here I want to figure it out with Windows 10 under Ruby 2.5.x. I tried two encodings 1251 and 65001 (UTF-8). In 1251, it does not display the Cyrillic alphabet, it just does not display and does not see because the value of the characters 0 is specified after I entered the name Andrei. And in utf-8 does not want to work. It produces different errors, something with bits is not that, something else (errors are different, depending on how and what I configure) Encoding rules in the console itself via chcp you will only save yourself if it is in this console that you output regular strings. But if you run the Ruby file with the code where you enter the Russian word in the variable, it will be just empty in the line output. I also edited the encoding in the "CodePages" or "CodePage" folder in the registry, writing from a phone is not nearby. Therefore, I can get a little wrong in the title. Already the test.rb file itself was saved in different encodings. And in the file I added the encoding # encoding: cp1251 and also tried UTF-8.

Help with customization. What am I doing wrong ?? Who in Windows 10 normally works with Cyrillic Ruby (with Russian text output) from version 2.4.4 and higher ?? Already two months suffer. I want it under Windows 10. For ubuntu, I know that everything is working fine there.

  • And if you just enter in Russian, it does not even count the characters. Just writes "0" letters! # coding: utf-8 print "Enter your name:" name = gets.strip.capitalize puts "Good time, \ t # {name} \ nIn your Name \ t # {name}, # {name.size} letters" PS D: \ Projects \ Ruby \ Lesson> ruby ​​test.rb Enter your name: Andrey !! Good time !! In your name !!, 8 letters - andrewua
  • And try to display name.bytes . - D-side
  • I can not set such a variable. The error is that the command is not correct. - andrewua
  • Why ask? Well I suggested to withdraw. And if you get an error, attach it to her, and not your own interpretation. - D-side
  • For more details ... how will I get her out? Tell me what actions to do. - andrewua

0