Commit 3d17f340 authored by Mikaël Salson's avatar Mikaël Salson

vidjil_utils.py: Anonymization and UTF-8 issues

When splitting a string in UTF-8 we may have some surprises as we would
cut a multi-byte character in the middle.
parent d2d9ed9a
Pipeline #20030 failed with stages
in 41 seconds
......@@ -109,7 +109,11 @@ def anon_names(sample_set_id, first_name, last_name, can_view=None):
if can_view or (can_view == None and auth.can_view_info('sample_set', sample_set_id)):
name = ln + " " + fn
else:
name = ln[:3]
current.log.debug(type(ln))
if isinstance(ln, unicode):
name = ln[:3]
else:
name = unicode(ln.decode('utf-8')[:3])
return name
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment