<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,5 +1,7 @@
 *2.3.0 [Edge]*
 
+* Multibyte: add multibyte-safe Chars#ord rather than falling back to String#ord.  #1483 [Jason Cheow]
+
 * I18n support for Array#to_sentence. Introduces support.array.words_connector, .two_words_connector, and .last_word_connector translation keys.  #1397 [Akira Matsuda]
 
 * Added ActiveSupport::OrderedHash#each_key and ActiveSupport::OrderedHash#each_value #1410 [Christoffer Sawicki]</diff>
      <filename>activesupport/CHANGELOG</filename>
    </modified>
    <modified>
      <diff>@@ -344,6 +344,14 @@ module ActiveSupport #:nodoc:
       end
       alias_method :[], :slice
 
+      # Converts first character in the string to Unicode value
+      #
+      # Example:
+      #   '&#12371;&#12435;&#12395;&#12385;&#12399;'.mb_chars.ord #=&gt; 12371
+      def ord
+        self.class.u_unpack(@wrapped_string)[0]
+      end
+
       # Convert characters in the string to uppercase.
       #
       # Example:</diff>
      <filename>activesupport/lib/active_support/multibyte/chars.rb</filename>
    </modified>
    <modified>
      <diff>@@ -397,6 +397,10 @@ class MultibyteCharsUTF8BehaviourTest &lt; Test::Unit::TestCase
     assert_raise(ArgumentError) { @chars.slice(1, 1, 1) }
   end
 
+  def test_ord_should_return_unicode_value_for_first_character
+    assert_equal 12371, @chars.ord
+  end
+
   def test_upcase_should_upcase_ascii_characters
     assert_equal '', ''.mb_chars.upcase
     assert_equal 'ABC', 'aBc'.mb_chars.upcase</diff>
      <filename>activesupport/test/multibyte_chars_test.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>9b22e56d89a55460a18d5f38adf9fee919f52266</id>
    </parent>
  </parents>
  <author>
    <name>Jason Cheow</name>
    <email>jfh7crw02@sneakemail.com</email>
  </author>
  <url>http://github.com/rails/rails/commit/4e60eebae05aeec65e4894e3901c9d61c9b32910</url>
  <id>4e60eebae05aeec65e4894e3901c9d61c9b32910</id>
  <committed-date>2008-12-08T16:02:57-08:00</committed-date>
  <authored-date>2008-11-26T06:16:28-08:00</authored-date>
  <message>Add ActiveSupport::Multibyte::Chars#ord method so that it returns correct Unicode value instead of falling back on String#ord in CoreExtensions, which is not multibyte compatible

[#1483 state:committed]

Signed-off-by: Jeremy Kemper &lt;jeremy@bitsweat.net&gt;</message>
  <tree>45cc75a790161a76c55da6db97a69cea56f95c42</tree>
  <committer>
    <name>Jeremy Kemper</name>
    <email>jeremy@bitsweat.net</email>
  </committer>
</commit>
