mirror of
https://opendev.org/x/pyghmi
synced 2025-07-25 05:31:11 +00:00
Fix chunk length when unicode on MCI
Unicode data probably won't work, but to the extent it could work, it would be incorrect to do length on the unicode rather than length of the utf-8 encoded data. Change-Id: Id39484abff603fdaab421f3395063b17edd3ae15
This commit is contained in:
@@ -1011,8 +1011,9 @@ class Command(object):
|
||||
chunks = [data[i:i+15] for i in xrange(0, len(data), 15)]
|
||||
offset = 0
|
||||
for chunk in chunks:
|
||||
chunk = bytearray(chunk, 'utf-8')
|
||||
cmddata = bytearray((0xdc, offset, len(chunk)))
|
||||
cmddata += bytearray(chunk, 'utf-8')
|
||||
cmddata += chunk
|
||||
self.xraw_command(netfn=0x2c, command=command, data=cmddata)
|
||||
|
||||
def set_channel_access(self, channel=None,
|
||||
|
Reference in New Issue
Block a user