#33218: slugify() can't handle Turkish İ while allow_unicode = True
---------------------------+--------------------------------------
     Reporter:  sowinski   |                    Owner:  nobody
         Type:  Bug        |                   Status:  closed
    Component:  Utilities  |                  Version:  dev
     Severity:  Normal     |               Resolution:  invalid
     Keywords:  slugify    |             Triage Stage:  Unreviewed
    Has patch:  0          |      Needs documentation:  0
  Needs tests:  0          |  Patch needs improvement:  0
Easy pickings:  0          |                    UI/UX:  0
---------------------------+--------------------------------------

Comment (by sowinski):

 Thank you for the fast response.

 I do not agree, because of this behavior it would be impossible to create
 an article for the capital of Turkey while allow_unicode=True.
 https://tr.wikipedia.org/wiki/%C4%B0stanbul

 Maybe someone else have a international website and will hit this problem.

 I solved the problem by adding the I to the regular expression.

 {{{
 value = re.sub(r'[^\w\si̇-]', '', value.lower())
 }}}

 I testes the implementation with all cities in the world with all the
 different language variants of the city name and it worked for me.
 http://www.geonames.org/

 It is interesting to see that this the only edge case. Not sure if this
 will work in all situations. So I run only my modification if the strange
 i is in the string. Otherwise is jump to the django implementation.

 See: https://github.com/wagtail/wagtail/issues/7637#issuecomment-949366560

-- 
Ticket URL: <https://code.djangoproject.com/ticket/33218#comment:2>
Django <https://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 unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.1912f678f16d72a10b5de29578159a0b%40djangoproject.com.

Reply via email to