Skip to content

Commit dbe9211

Browse files
committed
Tweaked unidecode_name() to not produce single-letter ascii surnames from non-ascii codepoints. The unidecode transliteration is in any case somewhat arbitrary, and in most cases a real person will tweak the ascii name of his account. When running tests, however, this tweak avoids some false test failures. And no, it's not simple to fix the draft author-extraction heuristics to deal well with single-letter surnames.
- Legacy-Id: 15239
1 parent 5f7fb2e commit dbe9211

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

ietf/person/name.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,8 @@ def unidecode_name(uname):
107107
first = first.title()
108108
middle = ' '.join([ capfirst(p) for p in middle.split() ])
109109
last = ' '.join([ capfirst(p) for p in last.split() ])
110+
if len(last) == 1:
111+
last = (last+last).capitalize()
110112
# Restore the particle, if any
111113
if particle and last.startswith(capfirst(particle)+' '):
112114
last = ' '.join([ particle, last[len(particle)+1:] ])

0 commit comments

Comments
 (0)