Created
September 10, 2015 03:43
-
-
Save abinoam/c8e81f7c0e851bee40f4 to your computer and use it in GitHub Desktop.
RbReadline multibyte support test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#coding: utf-8 | |
# This will remove old Readline if it's already defined | |
require 'rb-readline' | |
# This will load RbReadline for real | |
require 'rbreadline' | |
# This will load Readline that relies on RbReadline | |
require 'readline' | |
Readline.completion_proc = lambda do |str| | |
[ "pure_ascii", "with_utf_8_characters_like_ã_and_ç" ].grep(/\A#{Regexp.escape(str)}/) | |
end | |
line = Readline.readline("> ", false) | |
puts "Got: #{line}" | |
STDOUT.puts "RbReadline::RB_READLINE_VERSION #{RbReadline::RB_READLINE_VERSION}" | |
STDOUT.puts "Readline::VERSION #{Readline::VERSION}" | |
STDOUT.puts "RUBY_DESCRIPTION #{RUBY_DESCRIPTION}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I got this on my Mac: