add support for BOM-determined-endian UCS2, UTF-16, and UTF-32 to iconv
authorRich Felker <dalias@aerifal.cx>
Tue, 19 Dec 2017 03:08:54 +0000 (22:08 -0500)
committerRich Felker <dalias@aerifal.cx>
Tue, 19 Dec 2017 03:31:18 +0000 (22:31 -0500)
commit95c6044e2ae85846330814c4ac5ebf4102dbe02c
treeaf2c6f65ebcb37cca79713f72a678faf54117e9f
parent9d4d0ee41b06acf68dac40332f53be7bfbde7404
add support for BOM-determined-endian UCS2, UTF-16, and UTF-32 to iconv

previously, the charset names without endianness specified were always
interpreted as big endian. unicode specifies that UTF-16 and UTF-32
have BOM-determined endianness if BOM is present, and are otherwise
big endian. since commit 5b546faa67544af395d6407553762b37e9711157
added support for stateful encodings, it is now possible to implement
BOM support via the conversion descriptor state.

for conversions to these charsets, the output is always big endian and
does not have a BOM.
src/locale/iconv.c