Fix unicode error of device user's non-english name.
This commit is contained in:
parent
19f3133e92
commit
8f887a2037
@ -34,7 +34,7 @@ class User(object):
|
||||
return pack("<BHB8s24sIB7sx24s", 2, self.uid, self.privilege,self.password.encode(User.encoding, errors='ignore'), self.name.encode(User.encoding, errors='ignore'), self.card, 1, str(self.group_id).encode(User.encoding, errors='ignore'), str(self.user_id).encode(User.encoding, errors='ignore'))
|
||||
|
||||
def __str__(self):
|
||||
return '<User>: [uid:{}, name:{} user_id:{}]'.format(self.uid, self.name, self.user_id)
|
||||
return u'<User>: [uid:{}, name:{} user_id:{}]'.format(self.uid, self.name, self.user_id)
|
||||
|
||||
def __repr__(self):
|
||||
return '<User>: [uid:{}, name:{} user_id:{}]'.format(self.uid, self.name, self.user_id)
|
||||
return u'<User>: [uid:{}, name:{} user_id:{}]'.format(self.uid, self.name, self.user_id)
|
||||
|
Loading…
Reference in New Issue
Block a user