From 99f4237a691349b24afbed29abf33124b89c1ea3 Mon Sep 17 00:00:00 2001 From: Will Dietz Date: Thu, 3 May 2018 13:44:53 -0500 Subject: [PATCH] fix iconv conversion to UTF-32 with implicit (big) endianness maintainer's notes: commit 95c6044e2ae85846330814c4ac5ebf4102dbe02c split UTF-32 and UTF-32BE but neglected to add a case for the former as a destination encoding, resulting in it wrongly being handled by the default case. the intent was that the value of the macro be chosen to encode "big endian" in the low bits, so that no code would be needed, but this was botched; instead, handle it the way UCS2 is handled. --- src/locale/iconv.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/locale/iconv.c b/src/locale/iconv.c index 3c1f4dd2..3a34395c 100644 --- a/src/locale/iconv.c +++ b/src/locale/iconv.c @@ -646,6 +646,8 @@ size_t iconv(iconv_t cd, char **restrict in, size_t *restrict inb, char **restri *out += 4; *outb -= 4; break; + case UTF_32: + totype = UTF_32BE; case UTF_32BE: case UTF_32LE: if (*outb < 4) goto toobig; -- 2.25.1