From c30f664c71708391a16183c13fcfd0a0d52ffa6c Mon Sep 17 00:00:00 2001 From: Fumiaki MATSUSHIMA Date: Thu, 15 Nov 2018 01:33:05 +0900 Subject: Add test for normalizing non-unicode string Closes #34062 --- activesupport/test/multibyte_chars_test.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) 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) -- cgit v1.2.3