Encode problem when creating HOTP token

When i try to add HOTP token to ldap user i am getting the error:
File “/usr/lib/python2.7/dist-packages/privacyidea/lib/resolvers/LDAPIdResolver.py”, line 160, in cache_wrapper
func.func_name))
UnicodeEncodeError: ‘ascii’ codec can’t encode characters in position 3-6: ordinal not in range(128)

[2017-08-10 07:44:45,723][873][140373132470016][ERROR][privacyidea.lib.tokens.hotptoken:209] failed to set oath or google url: UnicodeEncodeError(‘ascii’,

This might be a known issue. Does the username contain non-ascii characters?

Then we might also have addressed this at github.
See https://github.com/privacyidea/privacyidea/issues/738

So you might take a look at the master branch, 2.20dev1 in pypi or in the PPA dev repo.

yes the user have non-ascii characters

This is probably fixed in master or 2.20dev1.