gecko-dev/intl/uconv
Nika Layzell aef919f890 Bug 1170668 - Improve short read handling in nsConverterInputStream, r=hsivonen
This patch changes how nsConverterInputStream handles passing data
through to the underlying unicode converter in order to make it more
reliably handle propagating errors and deal with short reads from the
underlying input stream.

This was done by making the code continuously read within the Fill
method until at least one character has been decoded from the input
stream, so that we don't spuriously communicate an EOF to the caller due
to a short read not producing enough bytes for the decoder to produce a
UTF-16 character.

In addition, while making this change it became easier to signal to
the decoder about the final read from the input stream, meaning that
partial characters at the end of the stream will now generate a
replacement character, rather than being ignored.

Differential Revision: https://phabricator.services.mozilla.com/D152682
2022-08-11 17:37:20 +00:00
..
crashtests
tests Bug 1170668 - Improve short read handling in nsConverterInputStream, r=hsivonen 2022-08-11 17:37:20 +00:00
components.conf
directory.txt
moz.build
nsConverterInputStream.cpp Bug 1170668 - Improve short read handling in nsConverterInputStream, r=hsivonen 2022-08-11 17:37:20 +00:00
nsConverterInputStream.h
nsConverterOutputStream.cpp
nsConverterOutputStream.h
nsIScriptableUConv.idl
nsITextToSubURI.idl
nsScriptableUConv.cpp
nsScriptableUConv.h
nsTextToSubURI.cpp
nsTextToSubURI.h