With sed
on dash
shell of LANG=en_US.UTF-8
, I got the followings working right:
$ echo "??? ????????" | sed -e 's/\(.\)/\1\n/g'
?
?
?
?
?
?
?
?
?
?
?
and
$ echo "Hello world" | sed -e 's/\(.\)/\1\n/g'
H
e
l
l
o
w
o
r
l
d
Thus, output can be looped with while read ... ; do ... ; done
edited for sample text translate into English:
"??? ????????" is zh_TW.UTF-8 encoding for:
"???" = How are you[ doing]
" " = a normal space character
"???" = Happy new year
"?????" = a double-byte-sized full-stop followed by text description