X-Git-Url: https://svn.cri.ensmp.fr/git/Plinn.git/blobdiff_plain/d7c8ba5c710b0b34ef8b1b718e5aefa327c06863..05761d9410d995e6602bd5d5f6e45d9dabbdd9b9:/utils.py?ds=inline diff --git a/utils.py b/utils.py index 14097e4..863b94e 100755 --- a/utils.py +++ b/utils.py @@ -18,8 +18,8 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # ####################################################################################### """ Plinn public utilities -$Id: utils.py 1534 2009-09-07 11:05:57Z pin $ -$URL: http://svn.cri.ensmp.fr/svn/Plinn/branches/CMF-2.1/utils.py $ + + """ import string @@ -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-_~,.$\(\)@]')