aboutsummaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorLars Kanis <lars@greiz-reinsdorf.de>2020-11-22 14:23:40 +0100
committerGitHub <noreply@github.com>2020-11-22 22:23:40 +0900
commitd403591b34e204a5937241025c62c877e579fbaf (patch)
tree2ba3966f5c792f74ed0f7873ea8f1def8efa63f3 /spec
parent2d112c346a7a1369af1236928538a3b3a833f781 (diff)
downloadruby-d403591b34e204a5937241025c62c877e579fbaf.tar.gz
Add string encoding IBM720 alias CP720 (#3803)
The mapping table is generated from the ICU project: https://github.com/unicode-org/icu/blob/master/icu4c/source/data/mappings/ibm-720_P100-1997.ucm Fixes bug 16233 : https://bugs.ruby-lang.org/issues/16233
Diffstat (limited to 'spec')
-rw-r--r--spec/ruby/core/string/valid_encoding_spec.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/ruby/core/string/valid_encoding_spec.rb b/spec/ruby/core/string/valid_encoding_spec.rb
index 09916df079..3e820a5c6d 100644
--- a/spec/ruby/core/string/valid_encoding_spec.rb
+++ b/spec/ruby/core/string/valid_encoding_spec.rb
@@ -100,6 +100,14 @@ describe "String#valid_encoding?" do
str.force_encoding('UTF8-MAC').valid_encoding?.should be_true
end
+ ruby_version_is '3.0' do
+ it "returns true for IBM720 encoding self is valid in" do
+ str = "\u{6754}"
+ str.force_encoding('IBM720').valid_encoding?.should be_true
+ str.force_encoding('CP720').valid_encoding?.should be_true
+ end
+ end
+
it "returns false if self is valid in one encoding, but invalid in the one it's tagged with" do
str = "\u{8765}"
str.valid_encoding?.should be_true