On Mon, 11 Sep 2017 00:03:26 +0100, David W Noon wrote:
>
>I have been doing some experiments on rendering Unicode and determining
>the length of rendered text compared to its storage in bytes. I have
>used Paul Gilmartin's 3 lines of text as sample data.
>
>I have 4 programs/scripts, of which 3 work and 1 can never work. The
>working programs are in C and C++, plus a script for zsh (a UNIX shell).
>The script that will never work is for bash (another UNIX shell).
>
And more. This:
#! /bin/sh
printit() {
"$I" -c "printf \"%-22s+++\n\" \"$@\""
}
doit() {
echo; echo ===== $I
printit "Привет мир."
printit "Emmanuel Macron"
printit "문재인"
printit "Enrique Peña Nieto"
printit "Владимир Путин"
printit "Donald Trump"
printit "习近平"
}
uname -a
for I in ash ksh dash csh tcsh zsh bash sh; do doit "$I"; done
... shows:
...
===== zsh
Привет мир. +++
Emmanuel Macron +++
문재인 +++
Enrique Peña Nieto +++
Владимир Путин +++
Donald Trump +++
习近平 +++
===== bash
Привет мир. +++
Emmanuel Macron +++
문재인 +++
Enrique Peña Nieto +++
Владимир Путин+++
Donald Trump +++
习近平 +++
...
zsh is not ideal, but still the best.
-- gil
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN