summaryrefslogtreecommitdiff
path: root/test/reline/test_reline.rb
diff options
context:
space:
mode:
authoraycabta <aycabta@gmail.com>2021-04-20 12:00:08 +0900
committeraycabta <aycabta@gmail.com>2021-06-21 17:58:48 +0900
commitb0cc46b484028b65b3306e9d19803e49c7b7cd58 (patch)
tree1cdf469221dbcf57c12f8ce7690018a691f7e257 /test/reline/test_reline.rb
parentc59bbd86a6bd0f1ce8a7babf56feabeb41a7e675 (diff)
[ruby/reline] The config file must accept any character encoding
In Japan, so many programmers used EUC-JP to write text files that contain Japanese. Many .inputrc files which contain EUC-JP are still being copied and used. This commit supports the whole encoding of what user set including UTF-8. ref. https://github.com/ruby/reline/pull/280 https://github.com/ruby/reline/commit/0b45022e16
Diffstat (limited to 'test/reline/test_reline.rb')
-rw-r--r--test/reline/test_reline.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/test/reline/test_reline.rb b/test/reline/test_reline.rb
index 0f32ec4421..ac182bbb14 100644
--- a/test/reline/test_reline.rb
+++ b/test/reline/test_reline.rb
@@ -314,6 +314,12 @@ class Reline::Test < Reline::TestCase
end
def get_reline_encoding
- RUBY_PLATFORM =~ /mswin|mingw/ ? Encoding::UTF_8 : Encoding::default_external
+ if encoding = (RELINE_TEST_ENCODING rescue nil)
+ encoding
+ elsif RUBY_PLATFORM =~ /mswin|mingw/
+ Encoding::UTF_8
+ else
+ Encoding::default_external
+ end
end
end