For each command, the entire user environment is being send to the server. Any variable in the environment can contain unicodes (e.g. PS1 - prompt configuration)
Sending messages works as follows:
given buffer buf (a string):
calculate the amount of bytes sent - by using len(buf)
send the header containing the length of the string message
convert string to bytes using bbuf = to_bytes(buf)
send bytes from bbuf
Bug lies in calculating the byte count: it should be calculated using bytes buffer, not string one.
For each command, the entire user environment is being send to the server. Any variable in the environment can contain unicodes (e.g. PS1 - prompt configuration)
Sending messages works as follows: given buffer
buf
(a string):len(buf)
string
tobytes
usingbbuf = to_bytes(buf)
bbuf
Bug lies in calculating the byte count: it should be calculated using
bytes
buffer, notstring
one.