Hi!

----

The following use of the  ${str:start:len}  with Cyrillic characters
doesn't seem to work in an Unicode locale like "en_US.UTF-8":
-- snip --
$ bash -c 'export LC_ALL=en_US.UTF-8 ; a="ифп" ; printf "%s\n"
"==${a:0:16}== OK!"'
==ифп== OK!
$ ~/bin/ksh -c 'export LC_ALL=en_US.UTF-8 ; a="ифп" ; printf "%s\n"
"==${a:0:16}== OK!"'
==иф== OK!
-- snip --

Testcase:
-- snip --
$ bash -c 'export LC_ALL=en_US.UTF-8 ; a=$(printf
"\xd0\xb8\xd1\x84\xd0\xbf\x0a") ; out=$(printf "%s\n" "==${a:0:16}==
OK!") ; [[ "$out" == "$(printf "==\xd0\xb8\xd1\x84\xd0\xbf== OK!")" ]]
|| printf "FAIL\n"'
$ ~/bin/ksh -c 'export LC_ALL=en_US.UTF-8 ; a=$(printf
"\xd0\xb8\xd1\x84\xd0\xbf\x0a") ; out=$(printf "%s\n" "==${a:0:16}==
OK!") ; [[ "$out" == "$(printf "==\xd0\xb8\xd1\x84\xd0\xbf== OK!")" ]]
|| printf "FAIL\n"'
FAIL
-- snip --

----

Bye,
Roland

-- 
  __ .  . __
 (o.\ \/ /.o) [email protected]
  \__\/\/__/  MPEG specialist, C&&JAVA&&Sun&&Unix programmer
  /O /==\ O\  TEL +49 641 3992797
 (;O/ \/ \O;)

_______________________________________________
ast-developers mailing list
[email protected]
https://mailman.research.att.com/mailman/listinfo/ast-developers

Reply via email to