bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

UTF8 and printf '%2s' (coreutils 5.2.1)


From: Tobias Burnus
Subject: UTF8 and printf '%2s' (coreutils 5.2.1)
Date: Wed, 04 Aug 2004 17:24:42 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7) Gecko/20040617

Hello,

I encountered the following issue in coreutils 5.2.1:
LANG=de_DE.UTF-8
/usr/bin/printf 'A%2sB\n' '2'
# Prints A 2B
/usr/bin/printf 'A%2sB\n' '²'
# Prints A²B instead of A ²B

In other words: printf counts 2byte UTF-8 characters as two characters
instead of one.

(BASH 2.05b's built-in printf has by the way the same problem, which is
fixed in BASH 3.0.)

Regards,

Tobias




reply via email to

[Prev in Thread] Current Thread [Next in Thread]