lib/lita/adapters/shell.rb in lita-3.3.0 vs lib/lita/adapters/shell.rb in lita-3.3.1
- old
+ new
@@ -52,10 +52,13 @@
def normalize_input(input)
input.chomp.strip
end
def read_input
- Readline.readline("#{robot.name} > ", true)
+ input = Readline.readline("#{robot.name} > ", true)
+ # Input read via rb-readline will always be encoded as US-ASCII.
+ # @see https://github.com/luislavena/rb-readline/blob/master/lib/readline.rb#L1
+ input.force_encoding(Encoding.default_external)
end
def run_loop
loop do
input = read_input