<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,3 +1,9 @@
+== 2.1.0 2009-03-25
+
+2 major enhancements:
+  * Ruby 1.9 compatibility.
+  * Removed dependency on ancient Unicode gem.
+
 == 2.0.4 2009-02-12
 
 * 1 major enhancment:</diff>
      <filename>History.txt</filename>
    </modified>
    <modified>
      <diff>@@ -240,12 +240,6 @@ discouraged:
 
   ./script/plugin install git://github.com/norman/friendly_id.git
 
-If you are installing as a plugin, make sure you have installed the unicode gem,
-which FriendlyId depends on:
-
-  gem install unicode
-
-
 == Setting it up
 
 FriendlyId currently works with Rails 2.0.0 - 2.3.0. Here's how to set it up.</diff>
      <filename>README.rdoc</filename>
    </modified>
    <modified>
      <diff>@@ -9,8 +9,8 @@ $hoe = Hoe.new(&quot;friendly_id&quot;, FriendlyId::Version::STRING) do |p|
   p.description = 'A comprehensive slugging and pretty-URL plugin for ActiveRecord.'
   p.url = 'http://friendly-id.rubyforge.org/'
   p.test_globs = ['test/**/*_test.rb']
-  p.extra_deps &lt;&lt; ['unicode', '&gt;= 0.1']
   p.extra_deps &lt;&lt; ['activerecord', '&gt;= 2.0.0']
+  p.extra_deps &lt;&lt; ['activesupport', '&gt;= 2.0.0']
   p.extra_dev_deps &lt;&lt; ['newgem', &quot;&gt;= #{::Newgem::VERSION}&quot;]
   p.extra_dev_deps &lt;&lt; ['Shoulda', &quot;&gt;= 1.2.0&quot;]
   p.extra_dev_deps &lt;&lt; ['sqlite3-ruby']</diff>
      <filename>Rakefile</filename>
    </modified>
    <modified>
      <diff>@@ -2,11 +2,10 @@
 
 Gem::Specification.new do |s|
   s.name = %q{friendly_id}
-  s.version = &quot;2.0.4&quot;
-
+  s.version = &quot;2.1.0&quot;
   s.required_rubygems_version = Gem::Requirement.new(&quot;&gt;= 0&quot;) if s.respond_to? :required_rubygems_version=
   s.authors = [&quot;Norman Clarke&quot;, &quot;Adrian Mugnolo&quot;, &quot;Emilio Tagua&quot;]
-  s.date = %q{2009-02-12}
+  s.date = %q{2009-03-25}
   s.description = %q{A comprehensive slugging and pretty-URL plugin for ActiveRecord.}
   s.email = [&quot;norman@randomba.org&quot;, &quot;adrian@randomba.org&quot;, &quot;miloops@gmail.com&quot;]
   s.extra_rdoc_files = [&quot;History.txt&quot;, &quot;Manifest.txt&quot;, &quot;README.rdoc&quot;]
@@ -25,23 +24,23 @@ Gem::Specification.new do |s|
     s.specification_version = 2
 
     if Gem::Version.new(Gem::RubyGemsVersion) &gt;= Gem::Version.new('1.2.0') then
-      s.add_runtime_dependency(%q&lt;unicode&gt;, [&quot;&gt;= 0.1&quot;])
       s.add_runtime_dependency(%q&lt;activerecord&gt;, [&quot;&gt;= 2.0.0&quot;])
+      s.add_runtime_dependency(%q&lt;activesupport&gt;, [&quot;&gt;= 2.0.0&quot;])
       s.add_development_dependency(%q&lt;newgem&gt;, [&quot;&gt;= 1.2.3&quot;])
       s.add_development_dependency(%q&lt;Shoulda&gt;, [&quot;&gt;= 1.2.0&quot;])
       s.add_development_dependency(%q&lt;sqlite3-ruby&gt;, [&quot;&gt;= 0&quot;])
       s.add_development_dependency(%q&lt;hoe&gt;, [&quot;&gt;= 1.8.0&quot;])
     else
-      s.add_dependency(%q&lt;unicode&gt;, [&quot;&gt;= 0.1&quot;])
       s.add_dependency(%q&lt;activerecord&gt;, [&quot;&gt;= 2.0.0&quot;])
+      s.add_dependency(%q&lt;activesupport&gt;, [&quot;&gt;= 2.0.0&quot;])
       s.add_dependency(%q&lt;newgem&gt;, [&quot;&gt;= 1.2.3&quot;])
       s.add_dependency(%q&lt;Shoulda&gt;, [&quot;&gt;= 1.2.0&quot;])
       s.add_dependency(%q&lt;sqlite3-ruby&gt;, [&quot;&gt;= 0&quot;])
       s.add_dependency(%q&lt;hoe&gt;, [&quot;&gt;= 1.8.0&quot;])
     end
   else
-    s.add_dependency(%q&lt;unicode&gt;, [&quot;&gt;= 0.1&quot;])
     s.add_dependency(%q&lt;activerecord&gt;, [&quot;&gt;= 2.0.0&quot;])
+    s.add_dependency(%q&lt;activesupport&gt;, [&quot;&gt;= 2.0.0&quot;])
     s.add_dependency(%q&lt;newgem&gt;, [&quot;&gt;= 1.2.3&quot;])
     s.add_dependency(%q&lt;Shoulda&gt;, [&quot;&gt;= 1.2.0&quot;])
     s.add_dependency(%q&lt;sqlite3-ruby&gt;, [&quot;&gt;= 0&quot;])</diff>
      <filename>friendly_id.gemspec</filename>
    </modified>
    <modified>
      <diff>@@ -1,9 +1,23 @@
-require 'unicode'
+#encoding: utf-8
+
 # A Slug is a unique, human-friendly identifier for an ActiveRecord.
 class Slug &lt; ActiveRecord::Base
 
   belongs_to :sluggable, :polymorphic =&gt; true
   before_save :check_for_blank_name, :set_sequence
+  
+  
+  ASCII_APPROXIMATIONS = {
+    198 =&gt; &quot;AE&quot;,
+    208 =&gt; &quot;D&quot;,
+    216 =&gt; &quot;O&quot;,
+    222 =&gt; &quot;Th&quot;,
+    223 =&gt; &quot;ss&quot;,
+    230 =&gt; &quot;ae&quot;,
+    240 =&gt; &quot;d&quot;,
+    248 =&gt; &quot;o&quot;,
+    254 =&gt; &quot;th&quot;
+  }.freeze
 
   class &lt;&lt; self
 
@@ -13,20 +27,14 @@ class Slug &lt; ActiveRecord::Base
     #
     #   slug.normalize('This... is an example!') # =&gt; &quot;this-is-an-example&quot;
     #
-    # Note that Rails 2.2.x offers a parameterize method for this. It's not
-    # used here because it assumes you want to strip away accented characters,
-    # and this may not always be your desire.
-    #
-    # At the time of writing, it also handles several characters incorrectly,
-    # for instance replacing Icelandic's &quot;thorn&quot; character with &quot;y&quot; rather
-    # than &quot;d.&quot; This might be pedantic, but I don't want to piss off the
-    # Vikings. The last time anyone pissed them off, they uleashed a wave of
-    # terror in Europe unlike anything ever seen before or after. I'm not
-    # taking any chances.
+    # Note that the Unicode handling in ActiveSupport may fail to process some
+    # characters from Polish, Icelandic and other languages. If your
+    # application uses these languages, check {out this
+    # article}[http://link-coming-soon.com] for information on how to get
+    # better urls in your application.
     def normalize(slug_text)
       return &quot;&quot; if slug_text.nil? || slug_text == &quot;&quot;
-      Unicode::normalize_KC(slug_text).
-        send(chars_func).
+      ActiveSupport::Multibyte.proxy_class.new(slug_text).normalize(:kc).
         # For some reason Spanish &#161; and &#191; are not detected as non-word
         # characters. Bug in Ruby?
         gsub(/[\W|&#161;|&#191;]/u, ' ').
@@ -36,6 +44,10 @@ class Slug &lt; ActiveRecord::Base
         downcase.
         to_s
     end
+    
+    def postnormalize(string)
+      string.gs
+    end
 
     def parse(friendly_id)
       name, sequence = friendly_id.split('--')
@@ -46,8 +58,17 @@ class Slug &lt; ActiveRecord::Base
     # Remove diacritics (accents, umlauts, etc.) from the string. Borrowed
     # from &quot;The Ruby Way.&quot;
     def strip_diacritics(string)
-      Unicode::normalize_KD(string).unpack('U*').select { |u| u &lt; 0x300 || u &gt; 0x036F }.pack('U*')
+      ActiveSupport::Multibyte.proxy_class.new(string).normalize(:kd).unpack('U*').inject([]) { |a, u| 
+        if ASCII_APPROXIMATIONS[u]
+          a += ASCII_APPROXIMATIONS[u].unpack('U*')
+        elsif (u &lt; 0x300 || u &gt; 0x036F)
+          a &lt;&lt; u
+        end
+        a
+      }.pack('U*')
     end
+
+
     
     # Remove non-ascii characters from the string.
     def strip_non_ascii(string)
@@ -75,7 +96,7 @@ class Slug &lt; ActiveRecord::Base
 
   # Raise a FriendlyId::SlugGenerationError if the slug name is blank.
   def check_for_blank_name #:nodoc:#
-    if name == &quot;&quot; || name.nil?
+    if name.blank?
       raise FriendlyId::SlugGenerationError.new(&quot;The slug text is blank.&quot;)
     end
   end</diff>
      <filename>lib/friendly_id/slug.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,8 +1,8 @@
 module FriendlyId #:nodoc:
   module Version #:nodoc:
     MAJOR = 2
-    MINOR = 0
-    TINY = 4
+    MINOR = 1
+    TINY = 0
     STRING = [MAJOR, MINOR, TINY].join('.')
   end
 end
\ No newline at end of file</diff>
      <filename>lib/friendly_id/version.rb</filename>
    </modified>
    <modified>
      <diff>@@ -39,8 +39,8 @@ class SlugTest &lt; Test::Unit::TestCase
       input  = &quot;&#192;&#193;&#194;&#195;&#196;&#197;&#198;&#199;&#200;&#202;&#203;&#204;&#205;&#206;&#207;&#208;&#209;&#210;&#211;&#212;&#213;&#214;&#216;&#217;&#218;&#219;&#220;&#221;&#222;&#223;&#224;&#225;&#226;&#227;&#228;&#229;&#230;&#231;&#232;&#233;&#234;&#235;&#236;&#237;&#238;&#239;&#240;&#241;&#242;&#243;&#244;&#245;&#246;&#248;&#249;&#250;&#251;&#252;&#253;&#254;&#255;&quot;
       output = Slug::strip_diacritics(input).split(//)
       expected = &quot;AAAAAAAECEEEIIIIDNOOOOOOUUUUYThssaaaaaaaeceeeeiiiidnoooooouuuuythy&quot;.split(//)
-      output.split.each_index do |i|
-        assert_equal output[i], expected[i]
+      output.each_index do |i|
+        assert_equal expected[i], output[i]
       end
     end
   </diff>
      <filename>test/slug_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -17,9 +17,9 @@ class SluggedModelTest &lt; Test::Unit::TestCase
     should &quot;have a slug&quot; do
       assert_not_nil @novel.slug
     end
-    
+
     context &quot;found by its friendly id&quot; do
-      
+
       setup do
         @novel = Novel.find(@novel.friendly_id)
       end
@@ -29,10 +29,10 @@ class SluggedModelTest &lt; Test::Unit::TestCase
       end
 
     end
-    
+
 
     context &quot;found by its numeric id&quot; do
-      
+
       setup do
         @novel = Novel.find(@novel.id)
       end</diff>
      <filename>test/sti_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,7 @@
 $:.unshift(File.dirname(__FILE__) + '/../lib')
 $:.unshift(File.dirname(__FILE__))
-$VERBOSE=false
+$KCODE = 'UTF8' if RUBY_VERSION &lt; '1.9'
+$VERBOSE = false
 require 'rubygems'
 require 'test/unit'
 require 'shoulda'
@@ -8,8 +9,10 @@ require 'shoulda'
 # The default is to use the latest installed ActiveRecord.
 if ENV[&quot;AR_VERSION&quot;]
   gem 'activerecord', &quot;#{ENV[&quot;AR_VERSION&quot;]}&quot;
+  gem 'activesupport', &quot;#{ENV[&quot;AR_VERSION&quot;]}&quot;
 end
 require 'active_record'
+require 'active_support'
 
 require 'friendly_id'
 require 'models/post'</diff>
      <filename>test/test_helper.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>2f296d0c51c3ea5045b1e176293c96c79486a1f4</id>
    </parent>
  </parents>
  <author>
    <name>Norman Clarke</name>
    <email>norman@randomba.org</email>
  </author>
  <url>http://github.com/norman/friendly_id/commit/7bf51d82d13bcf3ce49ae381dea1e7d43ea1fcd9</url>
  <id>7bf51d82d13bcf3ce49ae381dea1e7d43ea1fcd9</id>
  <committed-date>2009-03-25T06:07:17-07:00</committed-date>
  <authored-date>2009-03-25T06:04:24-07:00</authored-date>
  <message>Added Ruby 1.9 compatibility. Removed dependency on ancient Unicode gem.</message>
  <tree>10c6b8221b5aa8ca9e7863e7130fefbbe11d6967</tree>
  <committer>
    <name>Norman Clarke</name>
    <email>norman@randomba.org</email>
  </committer>
</commit>
