aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/multibyte.rb
diff options
context:
space:
mode:
authorNorman Clarke <norman@njclarke.com>2010-05-10 10:46:37 -0300
committerJeremy Kemper <jeremy@bitsweat.net>2010-05-21 12:24:54 -0700
commitf3abc8ac36055afed9fcc902c33ee146e066d17a (patch)
tree976019d8d451c2df0adc004d00e750b56fd6f6f6 /activesupport/lib/active_support/multibyte.rb
parentad4be3d75d46a04eb7a1d5a60bdfe68356a43e8b (diff)
downloadrails-f3abc8ac36055afed9fcc902c33ee146e066d17a.tar.gz
rails-f3abc8ac36055afed9fcc902c33ee146e066d17a.tar.bz2
rails-f3abc8ac36055afed9fcc902c33ee146e066d17a.zip
Use multibyte proxy class on 1.9, refactor Unicode.
Makes String#mb_chars on Ruby 1.9 return an instance of ActiveSupport::Multibyte::Chars to work around 1.9's lack of Unicode case folding. Refactors class methods from ActiveSupport::Multibyte::Chars into new Unicode module, adding other related functionality for consistency. [#4594 state:resolved] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
Diffstat (limited to 'activesupport/lib/active_support/multibyte.rb')
-rw-r--r--activesupport/lib/active_support/multibyte.rb20
1 files changed, 1 insertions, 19 deletions
diff --git a/activesupport/lib/active_support/multibyte.rb b/activesupport/lib/active_support/multibyte.rb
index 428c48a484..e7a271a660 100644
--- a/activesupport/lib/active_support/multibyte.rb
+++ b/activesupport/lib/active_support/multibyte.rb
@@ -1,30 +1,12 @@
# encoding: utf-8
-
require 'active_support/core_ext/module/attribute_accessors'
module ActiveSupport #:nodoc:
module Multibyte
autoload :EncodingError, 'active_support/multibyte/exceptions'
autoload :Chars, 'active_support/multibyte/chars'
- autoload :UnicodeDatabase, 'active_support/multibyte/unicode_database'
- autoload :Codepoint, 'active_support/multibyte/unicode_database'
- autoload :UCD, 'active_support/multibyte/unicode_database'
+ autoload :Unicode, 'active_support/multibyte/unicode'
- # A list of all available normalization forms. See http://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 = '5.1.0'
-
- # The default normalization used for operations that require normalization. It can be set to any of the
- # normalizations in NORMALIZATION_FORMS.
- #
- # Example:
- # ActiveSupport::Multibyte.default_normalization_form = :c
- mattr_accessor :default_normalization_form
- self.default_normalization_form = :kc
-
# The proxy class returned when calling mb_chars. You can use this accessor to configure your own proxy
# class so you can support other encodings. See the ActiveSupport::Multibyte::Chars implementation for
# an example how to do this.