Re: [pcre-dev] [Bug 1670] New: --color produces invalid UTF-…

Góra strony
Delete this message
Autor: ph10
Data:  
Dla: admin
CC: pcre-dev
Temat: Re: [pcre-dev] [Bug 1670] New: --color produces invalid UTF-8 for property matches
On Sat, 15 Aug 2015, admin@??? wrote:

> I???ve noticed when combining the --color option with matches against Unicode
> properties, the output is sometimes garbled (giving me a red replacement
> character followed by one or more normal replacement characters).
>
> I can reproduce this with accented characters on both PCRE and PCRE2.
>
> Precomposed ??:
> echo '??'|pcre2grep --color=always '\p{L}'|xxd
> 00000000: 1b5b 313b 3331 6dc3 1b5b 3030 6da0 0a    .[1;31m..[00m..


I think this is because you did not give pcre2grep the -u (--utf)
option. Without -u it will be processing the input byte by byte, not
character by character. Please try again with -u.

Philip

--
Philip Hazel