Re: unicode aware printf \u and \U switches not supported
From:
Greg Wooledge
Subject:
Re: unicode aware printf \u and \U switches not supported
Date:
Tue, 23 Mar 2010 08:16:45 -0400
User-agent:
Mutt/1.4.2.3i
On Mon, Mar 22, 2010 at 02:24:48PM +0100, Thomas Bartosik wrote:
> Repeat-By:
> tbart@blackknight ~ $ /usr/bin/printf "\u20AC\n"
> ?
> tbart@blackknight ~ $ type printf
> printf is a shell builtin
> tbart@blackknight ~ $ printf "\u20AC\n"
> \u20AC
Must be a GNUism. On HP-UX:
imadev:~$ /usr/bin/printf "\u20AC\n"
u20AC
imadev:~$ printf "\u20AC\n"
\u20AC
Wonder why the HP-UX printf(1) is eating the first backslash... *shrug*.
OpenBSD gives a warning:
cyclops:~$ /usr/bin/printf "\u20AC\n"
printf: unknown escape sequence `\u'
u20AC
cyclops:~$ echo $?
1
Then again, OpenBSD doesn't even have locale(1).