I was very excited when I saw this, but I can't get it to work on my
system -- though I admit to having no knowledge of multibyte
characters and I would guess my problem is either an environment
issue, or a change that is happening in Rails 2.3, but perhaps you
could point me in the right direction.

here's a sample of my output...

 ruby script/console
Loading development environment (Rails 2.3.0)


 
*******************************************************************
      * config.breakpoint_server has been deprecated and has no
effect. *
 
*******************************************************************

>> DiacriticsFu::escape('Réne')
=> "Réne"
>> ActiveSupport::VERSION::STRING
=> "2.3.0"
>> str = 'Réne'
=> "Réne"

>> a = ActiveSupport::Multibyte::Chars.new(str)
=> #<ActiveSupport::Multibyte::Chars:0x7f4165ec47c8
@wrapped_string="Réne">

>> a.normalize(:d)
=> #<ActiveSupport::Multibyte::Chars:0x7f4165ec17d0
@wrapped_string="Réne">

>> b = a.normalize(:d)
=> #<ActiveSupport::Multibyte::Chars:0x7f4165ebced8
@wrapped_string="Réne">

>> c = b.split(//u)
=> [#<ActiveSupport::Multibyte::Chars:0x7f4165eb91c0
@wrapped_string="R">, #<ActiveSupport::Multibyte::Chars:0x7f4165eb9148
@wrapped_string="e">, #<ActiveSupport::Multibyte::Chars:0x7f4165eb9080
@wrapped_string="́">, #<ActiveSupport::Multibyte::Chars:0x7f4165eb8fb8
@wrapped_string="n">, #<ActiveSupport::Multibyte::Chars:0x7f4165eb8ef0
@wrapped_string="e">]

>> c.map{|ch|ch.length}
=> [1, 1, 1, 1, 1]


So, on my system, what we expect would be a 4 character array with the
second of length > 1,
it's a 5 character array, each of length 1.

and just for kicks:

>> d = a.split(//u)
=> [#<ActiveSupport::Multibyte::Chars:0x7f4165ead618
@wrapped_string="R">, #<ActiveSupport::Multibyte::Chars:0x7f4165ead5a0
@wrapped_string="é">, #<ActiveSupport::Multibyte::Chars:0x7f4165ead4d8
@wrapped_string="n">, #<ActiveSupport::Multibyte::Chars:0x7f4165ead410
@wrapped_string="e">]

>> d.map{|ch|ch.length}
=> [1, 1, 1, 1]

>> e = b.split(//u)
=> [#<ActiveSupport::Multibyte::Chars:0x7f4165ea1458
@wrapped_string="R">, #<ActiveSupport::Multibyte::Chars:0x7f4165ea13e0
@wrapped_string="e">, #<ActiveSupport::Multibyte::Chars:0x7f4165ea1318
@wrapped_string="́">, #<ActiveSupport::Multibyte::Chars:0x7f4165ea1250
@wrapped_string="n">, #<ActiveSupport::Multibyte::Chars:0x7f4165ea1188
@wrapped_string="e">]
>> e.map{|ch|ch.length}
=> [1, 1, 1, 1, 1]


If you see something that could help me out, I'd appreciate it. Like I
said, this could come in very handy for me.

Thanks,

John Devine
[EMAIL PROTECTED]





On Dec 5, 4:20 pm, Thibaut Barrère <[EMAIL PROTECTED]> wrote:
> Hi,
>
> DiacriticsFu is a gem that relies on ActiveSupport to remove accents
> and other diacritics from a string. I use it when I need to generate
> urls on non-english-speaking CMS or blogs.
>
> Release 1.0.1 brings support for Rails 2.2+ (patch courtesy of Nicolas
> Fouché).
>
> === installation ===
>
> gem sources -ahttp://gems.github.com
>
> sudo gem install thbar-diacritics_fu
>
> (alternatively, clone fromhttp://github.com/thbar/diacritics_fu/tree/master)
>
> === compatibility ===
>
> DiacriticsFu has been tested against the following versions of
> ActiveSupport: 2.2.2, 2.1.2, 2.1.1, 2.1.0, 2.0.5, 2.0.2, 2.0.1, 1.4.4,
> 1.4.2.
>
> === examples ===
>
> DiacriticsFu::escape("éphémère")
> => "ephemere"
>
> DiacriticsFu::escape("räksmörgås")
> => "raksmorgas"
>
> === feedback ? ===
>
> In case you meet any issue, drop a mail ([EMAIL PROTECTED]).
>
> cheers,
>
> Thibaut Barrère
> --http://blog.logeek.frhttp://evolvingworker.com
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to