Re: [pcre-dev] \cx meaning

Kezdőlap
Üzenet törlése
Szerző: Philip Hazel
Dátum:  
Címzett: Ze'ev Atlas
CC: pcre exim
Tárgy: Re: [pcre-dev] \cx meaning
On Sun, 5 Aug 2012, Ze'ev Atlas wrote:

> \cx meaning
> [quote]
> (When PCRE is compiled in EBCDIC mode, all byte values are valid. A
> lower case letter is converted to upper case, and then the 0xc0 bits
> are flipped.)
> [/quote]
>
>  I am not sure I understand these words "and then the 0xc0 bits are
> flipped"!  Please explain to me (and perhaps modify the documentation
> next time), if we have, let's say, the letter 'A' which is \xC1 in
> EBCDIC, what would happen with the pattern /\cA/ ?


"the 0xc0 bits are flipped" means that each of those bits are changed to
the opposite value. That is

00xx xxxx => 11xx xxxx
01xx xxxx => 10xx xxxx
10xx xxxx => 01xx xxxx
11xx xxxx => 00xx xxxx

Thus EBCDIC 'A' (0xc1) will turn into 0x01. I will try to improve the
documentation to avoid the slang.

Philip

--
Philip Hazel