diff --git a/activesupport/CHANGELOG.md b/activesupport/CHANGELOG.md index ac389c2b5f..694e5f91b9 100644 --- a/activesupport/CHANGELOG.md +++ b/activesupport/CHANGELOG.md @@ -1,3 +1,7 @@ +* Deprecate `ActiveSupport::Multibyte::Unicode.default_normalization_form`. + + *Rafael Mendonça França* + * Remove deprecated `ActiveSupport::Multibyte::Unicode.pack_graphemes`, `ActiveSupport::Multibyte::Unicode.unpack_graphemes`, `ActiveSupport::Multibyte::Unicode.normalize`, diff --git a/activesupport/lib/active_support/multibyte/unicode.rb b/activesupport/lib/active_support/multibyte/unicode.rb index 072824339f..761cb6f741 100644 --- a/activesupport/lib/active_support/multibyte/unicode.rb +++ b/activesupport/lib/active_support/multibyte/unicode.rb @@ -5,20 +5,20 @@ module ActiveSupport module Unicode extend self - # A list of all available normalization forms. - # See https://www.unicode.org/reports/tr15/tr15-29.html for more - # information about normalization. - NORMALIZATION_FORMS = [:c, :kc, :d, :kd] - # The Unicode version that is supported by the implementation UNICODE_VERSION = RbConfig::CONFIG["UNICODE_VERSION"] - # The default normalization used for operations that require - # normalization. It can be set to any of the normalizations - # in NORMALIZATION_FORMS. - # - # ActiveSupport::Multibyte::Unicode.default_normalization_form = :c - attr_accessor :default_normalization_form # TODO: Deprecate + def default_normalization_form + ActiveSupport::Deprecation.warn( + "ActiveSupport::Multibyte::Unicode.default_normalization_form is deprecated and will be removed in Rails 6.1" + ) + end + + def default_normalization_form=(_) + ActiveSupport::Deprecation.warn( + "ActiveSupport::Multibyte::Unicode.default_normalization_form= is deprecated and will be removed in Rails 6.1" + ) + end # Decompose composed characters to the decomposed form. def decompose(type, codepoints) diff --git a/guides/source/6_1_release_notes.md b/guides/source/6_1_release_notes.md index eb74f1bb2c..880380b315 100644 --- a/guides/source/6_1_release_notes.md +++ b/guides/source/6_1_release_notes.md @@ -314,6 +314,8 @@ Please refer to the [Changelog][active-support] for detailed changes. ### Deprecations +* Deprecate `ActiveSupport::Multibyte::Unicode.default_normalization_form`. + ### Notable changes Active Job