From a9f5544ff60bcc113253861f463471b169def545 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Wed, 25 Dec 2019 14:18:49 -0800 Subject: [PATCH] Document AIX 7.2 printf command gotcha * doc/autoconf.texi (Limitations of Builtins): Document AIX 7.2 sh printf problem with octal escapes. --- doc/autoconf.texi | 6 ++++++ 1 file changed, 6 insertions(+) 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 -- 2.47.2