-# -*- coding: utf-8 -*-
+# This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later.
+# Copyright © Fundacja Wolne Lektury. See NOTICE for more information.
+#
import re
from fnpdjango.utils.text import char_map
# Specifies diacritics order.
# Default order is zero, max is 9
char_order = {
- u'ż': 1, u'Ż': 1,
+ 'ż': 1, 'Ż': 1,
}
value = value.lower()
value = re.sub(r'[^a-z0-9~]+', ' ', value)
- return value.encode('ascii', 'ignore')
+ return value.encode('ascii', 'ignore').decode('ascii')