﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
33218	slugify() can't handle Turkish İ while allow_unicode = True	sowinski	nobody	"Please see the following example.
The first character **test_str = ""i̇zmit""** is not a normal i. It is the **İ** from the Turkish alphabet. 

Using allow_unicode=True should keep the Turkish **İ** instead of replacing it with a normal i.



{{{
import unicodedata
import re

def slugify(value, allow_unicode=False):
    """"""
    Convert to ASCII if 'allow_unicode' is False. Convert spaces or repeated
    dashes to single dashes. Remove characters that aren't alphanumerics,
    underscores, or hyphens. Convert to lowercase. Also strip leading and
    trailing whitespace, dashes, and underscores.
    """"""
    value = str(value)
    if allow_unicode:
        value = unicodedata.normalize('NFKC', value)
    else:
        value = unicodedata.normalize('NFKD', value).encode('ascii', 'ignore').decode('ascii')
    value = re.sub(r'[^\w\s-]', '', value.lower())
    return re.sub(r'[-\s]+', '-', value).strip('-_')


test_str = ""i̇zmit""

output = slugify(test_str, allow_unicode = True)

print(test_str)
print(output)
print(test_str == output)
}}}


"	Bug	closed	Utilities	dev	Normal	invalid	slugify		Unreviewed	0	0	0	0	0	0
