Chris Down wrote:
I don't have much of an opinion on whether this behaviour is right or wrong in the context of bash, but if this behaviour is changed, I think it should be done under another format character, rather than changing %s (or changing behaviour when not in POSIX-compliance mode).
IMHO my example demonstrates clearly, that printf output of UTF-8 chars is broken, (doesn't matter, if it is or not POSIX compliant). To solve this problem I suppose to add "wide" switch to printf or to add "%S" format (similarly to wprintf(3) ) $ printf -w "|%4s|\n" "áá" or $ printf "|%4S|\n" "áá" | áá|