From 022268ae009bd87b13e1f5ee46011b7142987d57 Mon Sep 17 00:00:00 2001 From: Yusuke Endoh Date: Thu, 13 Feb 2020 22:58:15 +0900 Subject: [PATCH] spec/ruby/core/encoding/locale_charmap_spec.rb: locale_charmap is UTF-8 on Android nl_langinfo(CODESET) always returns UTF-8 on Android, regardless to LC_ALL=C. --- .../ruby/core/encoding/locale_charmap_spec.rb | 21 ++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/spec/ruby/core/encoding/locale_charmap_spec.rb b/spec/ruby/core/encoding/locale_charmap_spec.rb index 5963a8beb5..8143b9083a 100644 --- a/spec/ruby/core/encoding/locale_charmap_spec.rb +++ b/spec/ruby/core/encoding/locale_charmap_spec.rb @@ -7,11 +7,13 @@ describe "Encoding.locale_charmap" do # FIXME: Get this working on Windows platform_is :linux do - it "returns a value based on the LC_ALL environment variable" do - old_lc_all = ENV['LC_ALL'] - ENV['LC_ALL'] = 'C' - ruby_exe("print Encoding.locale_charmap").should == 'ANSI_X3.4-1968' - ENV['LC_ALL'] = old_lc_all + platform_is_not :android do + it "returns a value based on the LC_ALL environment variable" do + old_lc_all = ENV['LC_ALL'] + ENV['LC_ALL'] = 'C' + ruby_exe("print Encoding.locale_charmap").should == 'ANSI_X3.4-1968' + ENV['LC_ALL'] = old_lc_all + end end end @@ -33,6 +35,15 @@ describe "Encoding.locale_charmap" do end end + platform_is :android do + it "always returns UTF-8" do + old_lc_all = ENV['LC_ALL'] + ENV['LC_ALL'] = 'C' + ruby_exe("print Encoding.locale_charmap").should == 'UTF-8' + ENV['LC_ALL'] = old_lc_all + end + end + platform_is :bsd, :darwin, :linux do it "is unaffected by assigning to ENV['LC_ALL'] in the same process" do old_charmap = Encoding.locale_charmap