Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: mangling of non-ascii char in prompt



On Wed, Jan 11, 2006 at 09:29:50PM -0500, Clint Adams wrote:
> % LANG=hr_HR.UTF-8
> % PS1="%D{%a}%# "

The problem appears to be that the UTF-8 string coming from %D{%a} is
not being metafied, so zputs() is outputting the string wrong.  The
above PS1 setting on a Thursday results in this 4-char string being
assigned to lpromptbuf:

    \304\254et

The second character does not pass the itok() test, so it is skipped,
mangling the output.

If I assign the above 4-character string directly to PS1 via a variable,
the second character is properly metafied:

    \304\203\254et

And the string outputs correctly.

..wayne..



Messages sorted by: Reverse Date, Date, Thread, Author