Re: Locale not Obeyed by Parameter Expansion with Pattern Substitution

2019-11-20 Thread Chet Ramey
On 11/17/19 4:25 AM, Chris Carlen wrote: Bash Version: 5.0 Patch Level: 0 Release Status: release Description:   UTF-8 multibyte char string split into bytes rather than characters. Repeat-By: #!/bin/bash shopt -s extglob LC_ALL="en_US.UTF-8" # E.g., normal/expected behavior: # Create a s

Re: Locale not Obeyed by Parameter Expansion with Pattern Substitution

2019-11-18 Thread Stephane Chazelas
2019-11-18 20:46:26 +, Stephane Chazelas: [...] > > printf -v B '\u204B' > > set -- ${B//?()/ } > > echo "${@@Q}" #-> $'\342' $'\201' $'\213' [...] > It seems to me that zsh's approach is best: > > $ A=$'\u2048\201\u2048' zsh -c "printf '%q\n' \"\${A//$'\201'/:}\"" > ⁈:⁈ > > That is re

Re: Locale not Obeyed by Parameter Expansion with Pattern Substitution

2019-11-18 Thread Stephane Chazelas
2019-11-17 01:25:31 -0800, Chris Carlen: [...] > # write 'REVERSE PILCROW SIGN' to B, then repeat as above: > printf -v B '\u204B' > set -- ${B//?()/ } > echo "${@@Q}" #-> $'\342' $'\201' $'\213' > > # NOTE: Since there is only one character (under the UTF-8 locale), > # this should have set