#41 ${(%)x} and ${(%%)x} break multibyte chars

open-fixed
Core shell (16)
5
2009-03-10
2008-10-20
No

using some multibyte characters inside a parameter which are extended via (%) or (%%) get messed up. I used them for a nice unicode prompt and tryed to calculate the length of the expanded expression. something like what.

host='╭───[%n@%m]'
echo "${host}" ## displays perfectly
echo "${(%%)host}" ## messes up multibyte chars
echo "${#${(%%)host}}" ## consequently wrong size
PS1="${host}" ## displays perfectly as prompt

I tryed ubuntu intrepid's and ubuntu hardy's version of the zsh package both don't work so it might be a bug.

intrepid:
zsh --version
zsh 4.3.6 (x86_64-unknown-linux-gnu)

hardy:
zsh --version
zsh 4.3.4 (x86_64-unknown-linux-gnu)

Discussion

  • Peter Stephenson

    • labels: --> Core shell
    • assigned_to: nobody --> pws
    • status: open --> open-fixed
     
  • Peter Stephenson

    Believed fixed by patch zsh-workers/26705 on the zsh-workers mailing list.

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks