From 67a31d1f58ec7b9b85389a6bee25ac724ccb84ed Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Sun, 14 Nov 2010 19:58:33 +0100 Subject: [PATCH] use unicodedata.normalize for sort_title --- pandora/item/utils.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pandora/item/utils.py b/pandora/item/utils.py index ae1f003e..0ad804cf 100644 --- a/pandora/item/utils.py +++ b/pandora/item/utils.py @@ -7,6 +7,7 @@ import os import sys import re import hashlib +import unicodedata import ox import ox.iso @@ -164,7 +165,10 @@ def parse_path(path): def sort_title(title): #title title = re.sub(u'[\'!¿¡,\.;\-"\:\*\[\]]', '', title) - title = title.replace(u'Æ', 'Ae') + + #title = title.replace(u'Æ', 'Ae') + title = unicodedata.normalize('NFKD',title) + #pad numbered titles title = re.sub('(\d+)', lambda x: '%010d' % int(x.group(0)), title) return title.strip()