bgnet0 icon indicating copy to clipboard operation
bgnet0 copied to clipboard

Bugfix wordserver: Prefix with length in bytes, not length in Unicode characters

Open markusdobler opened this issue 11 months ago • 0 comments

As described in section 13.2 of the Word Server project, each packet should contain a UTF-8 encoded word "prefixed by the length of the word in bytes". However, the current implementation actually uses the length in characters, which differs if a word contains multi-byte characters.

Fixing this by using the length in bytes of the encoded word (len(word_bytes)) instead of the length in characters of the un-encoded word (len(word)).

markusdobler avatar Mar 18 '24 16:03 markusdobler