From: Paul Eggert Date: Wed, 25 Dec 2019 22:18:49 +0000 (-0800) Subject: Document AIX 7.2 printf command gotcha X-Git-Tag: v2.69b~33 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a9f5544ff60bcc113253861f463471b169def545;p=thirdparty%2Fautoconf.git Document AIX 7.2 printf command gotcha * doc/autoconf.texi (Limitations of Builtins): Document AIX 7.2 sh printf problem with octal escapes. --- diff --git a/doc/autoconf.texi b/doc/autoconf.texi index 2ac66969..a591912a 100644 --- a/doc/autoconf.texi +++ b/doc/autoconf.texi @@ -17987,6 +17987,12 @@ or @samp{%s} is probably easiest: printf %s -foo @end example +AIX 7.2 @command{sh} mishandles octal escapes in multi-byte locales by +treating them as characters instead of bytes. For example, in a locale +using the UTF-8 encoding, @samp{printf '\351'} outputs the two bytes C3, +A9 (the UTF-8 encoding for U+00E9) instead of the desired single byte E9. +To work around the bug, use the C locale. + Bash 2.03 mishandles an escape sequence that happens to evaluate to @samp{%}: @example