[Toybox] [PATCH] Fix iconv and tests on Mac.

enh enh at google.com
Fri Nov 22 13:38:52 PST 2019


The Mac iconv_open(3) doesn't follow Unicode TR#22 rules for charset
alias matching that bionic and glibc do (and, strictly, POSIX doesn't
say you have to even though it's obviously a good idea), so we have
to say exactly "UTF-8" rather than "utf8".

Additionally, the 2006-era bash 3.2 on current versions of macOS
(because it was the last GPLv2 bash) seems to have bugs that cause
it to mangle UTF-8 input, so we can't reliably echo a UTF-8 sequence
into a file. Use \x in the tests to work around this.

---
 tests/iconv.test   | 13 ++++++++-----
 toys/posix/iconv.c |  8 ++++----
 2 files changed, 12 insertions(+), 9 deletions(-)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Fix-iconv-and-tests-on-Mac.patch
Type: application/octet-stream
Size: 2917 bytes
Desc: not available
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20191122/fad59eb1/attachment-0002.obj>


More information about the Toybox mailing list