S
S
Sergey Saifulin2014-01-07 23:07:49
ruby
Sergey Saifulin, 2014-01-07 23:07:49

Ruby: Cyrillic and command line?

I am learning Ruby. Version 1.9.3. SciTE editor. When you enter the following code and try to run it through the console, you get an " invalid multibyte char (US-ASCII)
" error . Mechanically, the code works when # encoding: IBM866 is used at the beginning of the code , but in this case, the so-called. "krakozyabry". How to make this mechanism work correctly with Cyrillic? If possible, write the answer as for a person who comprehends this knowledge from scratch.

puts 'Приветик, ну и как Вас зовут?'
name = gets.chomp
puts 'Вас зовут ' + name + '?  Какое прекрасное имя!'
puts 'Рад познакомиться с Вами, ' + name + '.  :)'

Answer the question

In order to leave comments, you need to log in

1 answer(s)
C
CAMOKPYT, 2014-01-08
@Vanilla_Sunset

# coding: utf-8
and in the console chcp 65001

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question