#8391: Results of slugify in the admin interface differ from the one in shell.
------------------------------------+---------------------------------------
          Reporter:  bjornkri       |         Owner:  nobody
            Status:  new            |     Milestone:        
         Component:  Uncategorized  |       Version:  SVN   
        Resolution:                 |      Keywords:        
             Stage:  Unreviewed     |     Has_patch:  0     
        Needs_docs:  0              |   Needs_tests:  0     
Needs_better_patch:  0              |  
------------------------------------+---------------------------------------
Comment (by bjornkri):

 Yep, I've been digging in and found the same. I absolutely think the two
 should work the same way, especially since it would make my like so much
 easier ;)

 > {{{
 > var LATIN_MAP = {
 >    ...
 >    'ø': 'o',
 >    ...
 > }
 > }}}

 I'm trying to translate the javascript into Python, but python's handling
 of this is giving me a headache. In the javascript function, there's a
 regular expression that matches one or more characters not in, a sequence
 of characters in, the list of special characters.

 As an example, 'bjørn' becomes 'bj', 'ø' and 'rn'. It then tries to find
 these in the above map: LATIN_MAP['bj'] returns nothing so it's left
 unchanged, LATIN_MAP['ø'] returns 'o', and LATIN_MAP['rn'] nothing again.
 The result is 'bjorn'

 Python, on the other hand, matches 'bj', '\xc3' and '\xb8rn'. There is no
 match for '\xc3' in LATIN_MAP, only in the regexp. Now I just need to find
 a way of splitting this correctly, any ideas?

-- 
Ticket URL: <http://code.djangoproject.com/ticket/8391#comment:4>
Django Code <http://code.djangoproject.com/>
The web framework for perfectionists with deadlines
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to