This project is archived and is in readonly mode.

#2428 ✓duplicate
Andy Stewart

Unicode-aware rindex method

Reported by Andy Stewart | April 6th, 2009 @ 09:15 AM | in 2.x

The ActiveSupport::Multibyte::Chars class does not implement a Unicode-aware rindex method, despite claiming that "all the normal String methods are also implemented on the proxy." (I suppose it depends what normal means ;)

This means that rindex is broken in a Unicode environment.

Attached is a patch with tests which implements a Unicode-aware rindex method. I have implemented it in terms of Chars' existing encoding-safe methods.

Comments and changes to this ticket

  • Jeremy Kemper

    Jeremy Kemper August 10th, 2009 @ 07:29 AM

    • State changed from “new” to “duplicate”

    #3028. Unfortunately this ticket was overlooked before putting efforts into a new one!

  • Erik Ostrom

    Erik Ostrom August 10th, 2009 @ 07:31 AM

    This patch no longer applies directly to master (or, the code no longer works, due to a change in the multibyte implementation). In the meantime someone filed a duplicate (#3028) and during the bugmash I wrote a patch for that before noticing this preexisting ticket. Whoops!

    I recommend closing this ticket.

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

People watching this ticket

Attachments

Referenced by

Pages