Decode a UTF-8 string that may be cut off

Let's say we got some bytestring through a socket, but it was cut off in the middle of a UTF-8 character.

We can simulate this:

wzxhzdk:0

So, is this string completely undecodable? Can't we just get "прикла"?
Don't worry, I have a solution. Works with 3.x and 2.7!

wzxhzdk:1


Created
Comments powered by Disqus