I am getting used to asyncio and find the task handling quite nice, but it can be difficult to mix async libraries with traditional io libraries. The problem I am currently fac
You can use an IncrementalDecoder:
Utf8Decoder = codecs.getincrementaldecoder('utf-8')
With your example:
decoder = Utf8Decoder(error='strict') while not stream.at_eof(): data = await stream.read(4) print(decoder.decode(data), end='')
Output:
Mädchen mit Biß