#711 ✓resolved
Liam Morley (carpeliam)

dm-types Slug non-ascii specs fail for me

Reported by Liam Morley (carpeliam) | December 14th, 2008 @ 07:05 PM | in 0.10.0

I get the following spec failure when running the specs in dm-types on a fresh checkout from sam's dm-more:

1) 'DataMapper::Types::Slug should sluggify Iñtërnâtiônàlizætiøn' FAILED expected not nil, got nil /tmp/dm-more/dm-types/spec/integration/slug_spec.rb:48:

When attempting to use Slug in my application, creating a slug with Föö Bár has an output of "f-br"; the expectation here would be "foo-bar".

Comments and changes to this ticket

  • Liam Morley (carpeliam)

    Liam Morley (carpeliam) December 14th, 2008 @ 07:07 PM

    My environment: OS: Ubuntu Intrepid Ruby: ruby 1.8.7 (2008-08-11 patchlevel 72) [x86_64-linux]

    let me know if you need any further details.

  • Dan Kubb (dkubb)

    Dan Kubb (dkubb) January 8th, 2009 @ 02:48 PM

    • Assigned user set to “Michael Klishin (antares)”
  • Liam Morley (carpeliam)

    Liam Morley (carpeliam) January 8th, 2009 @ 03:50 PM

    Update (as it's been a little while since this bug was posted): I can't run the tests from a fresh source without installing dm-core 0.9.10 (which I can't really do on my machine), but I can say that the test fails on the most recent released gem, 0.9.9. GitHub says that the Slug type hasn't been updated since October, so I imagine that the bug is still present, unless the bug is inadvertently fixed by a dm-core upgrade.

  • Michael Klishin (antares)

    Michael Klishin (antares) January 13th, 2009 @ 05:16 AM

    • Tag changed from types to dm-types, m17n

    Interesting, what is your locales configuration? LOCALE, LC_*, all that. I have Ubuntu box at hand to try.

  • felix (xilef)

    felix (xilef) January 13th, 2009 @ 07:50 AM

    • Tag changed from dm-types, m17n to dm-types, i18n, m17n

    I had issues with this a while ago, cannot remember what they were but something along the lines of what should be expected in the tests. I am not sure if the order of the iconv options matters:


    instead of


    to attempt transliterating them before ignoring them ie 'foo-bar' before 'f-br' but it should not return nil for 'Iñtërnâtiônàlizætiøn' still.

  • Michael Klishin (antares)

    Michael Klishin (antares) March 31st, 2009 @ 02:46 PM

    • Milestone set to 0.10.0
    • State changed from “unconfirmed” to “accepted”
  • Dan Kubb (dkubb)

    Dan Kubb (dkubb) August 11th, 2009 @ 11:12 AM

    • Assigned user changed from “Michael Klishin (antares)” to “Dan Kubb (dkubb)”
    • State changed from “accepted” to “resolved”

    There is a problem with iconv on Unbuntu and it returns completely different results for the same string as on OSX.

    I've removed the usage of iconv from dm-types, and used stringex (a pure-ruby gem) to normalize the string, which produces even better results than the original approach.

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

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