On Tue, 5 Sep 2017 10:19:45 -0500, Paul Gilmartin
([email protected]) wrote about "Re: UTF-8
woes on z/OS, a solution - comments invited" (in
<[email protected]>):

[snip]
> What language(s) cleanly handle vertical alignment of formatted text output 
> when
> the text contains UTF-16 supplemental/surrogate (not in the BMP) characters?

Python and Java, at least.

> Here's an example of /bin/printf's failure for similar input with UTF-8 on 
> MacOS:
> 
> The script:
> printf "%-22s+++\n" "Hello World."
> printf "%-22s+++\n" "Привет мир."
> printf "%-22s+++\n" "Bonjour le monde."
> 
> writes:
> Hello World.          +++
> Привет мир.  +++
> Bonjour le monde.     +++
> 
> I wish the "+++" would line up (at least in a monospaced font).

This is a bug in your printf UNIX command. It is counting bytes to
determine print position, rather than counting glyphs. It probably isn't
Unicode-aware.
-- 
Regards,

Dave  [RLU #314465]
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
[email protected] (David W Noon)
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

 

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to