From 492bf0fb7e0204ec727c3639af6c5ea4006ef611 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Beno=C3=AEt=20Pin?= Date: Mon, 4 Jul 2011 11:40:11 +0200 Subject: [PATCH 1/1] =?utf8?q?Affichage=20du=20nom=20de=20famille=20en=20m?= =?utf8?q?ajuscules=20(traitement=20des=20noms=20en=20unicode=20pour=20une?= =?utf8?q?=20capitalisation=20correcte=20des=20caract=C3=A8res=20accentu?= =?utf8?q?=C3=A9s).?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- utils.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/utils.py b/utils.py index e867b0d..863b94e 100755 --- a/utils.py +++ b/utils.py @@ -87,15 +87,17 @@ def capitalizeCompoundGivenName(givenName) : def formatFullName(memberName, memberGivenName, memberId, nameBefore=1) : - memberFullName = '' + memberName = memberName.decode('utf-8') + memberGivenName = memberGivenName.decode('utf-8') + memberFullName = u'' if memberName and memberGivenName : if nameBefore : - memberFullName = memberName.capitalize() + ' ' + capitalizeCompoundGivenName(memberGivenName) + memberFullName = memberName.upper() + ' ' + capitalizeCompoundGivenName(memberGivenName) else : - memberFullName = capitalizeCompoundGivenName(memberGivenName) + ' ' + memberName.capitalize() + memberFullName = capitalizeCompoundGivenName(memberGivenName) + ' ' + memberName.upper() elif memberName and not memberGivenName : - memberFullName = memberName.capitalize() + memberFullName = memberName.upper() elif not memberName and memberGivenName : memberFullName = capitalizeCompoundGivenName(memberGivenName) @@ -103,7 +105,7 @@ def formatFullName(memberName, memberGivenName, memberId, nameBefore=1) : else : memberFullName = memberId - return memberFullName + return memberFullName.encode('utf-8') # from OFS.ObjectManager #63 bad_url_chars = re.compile(r'[^a-zA-Z0-9-_~,.$\(\)@]') -- 2.20.1