diff options
author | Fumiaki MATSUSHIMA <mtsmfm@gmail.com> | 2018-11-15 01:33:05 +0900 |
---|---|---|
committer | Fumiaki MATSUSHIMA <mtsmfm@gmail.com> | 2018-11-15 01:34:05 +0900 |
commit | c30f664c71708391a16183c13fcfd0a0d52ffa6c (patch) | |
tree | 3d4bce631e7640e5a30696c58f1c91d13c6f9836 /activesupport | |
parent | 79d2d33489728f06838322d84da8de8f05b6afa1 (diff) | |
download | rails-c30f664c71708391a16183c13fcfd0a0d52ffa6c.tar.gz rails-c30f664c71708391a16183c13fcfd0a0d52ffa6c.tar.bz2 rails-c30f664c71708391a16183c13fcfd0a0d52ffa6c.zip |
Add test for normalizing non-unicode string
Closes #34062
Diffstat (limited to 'activesupport')
-rw-r--r-- | activesupport/test/multibyte_chars_test.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/activesupport/test/multibyte_chars_test.rb b/activesupport/test/multibyte_chars_test.rb index f87099566b..5f4e3f3fd3 100644 --- a/activesupport/test/multibyte_chars_test.rb +++ b/activesupport/test/multibyte_chars_test.rb @@ -772,6 +772,16 @@ class MultibyteCharsExtrasTest < ActiveSupport::TestCase assert_deprecated { ActiveSupport::Multibyte::Unicode.swapcase("") } end + def test_normalize_non_unicode_string + # Fullwidth Latin Capital Letter A in Windows 31J + str = "\u{ff21}".encode(Encoding::Windows_31J) + assert_raise Encoding::CompatibilityError do + ActiveSupport::Deprecation.silence do + ActiveSupport::Multibyte::Unicode.normalize(str) + end + end + end + private def string_from_classes(classes) |