[fpc-pascal] WideString and TRegexpr

Mark Morgan Lloyd markMLl.fpc-pascal at telemetry.co.uk
Sat Dec 3 15:14:53 CET 2011


Mark Morgan Lloyd wrote:
> Has anybody with experience of WideStrings tried compiling the "new" 
> Regexpr unit to support them?
> 
> I'm in a position where I could very much benefit from using these, but 
> I think that I'm only seeing patterns match for characters <= #$00ff and 
> even then am not seeing the match strings returned.

This appears to be an endianness issue: on a little-endian system 
(including x86) the Match[] entries only contain the LS byte of a 
widechar and on a big-endian system (incluing PPC) they only contain the 
MS byte. Practical result is that things look OK on x86 until the match 
contains a value > #$00ff.

I'm putting test data together for various CPUs and will raise a bug.

-- 
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]



More information about the fpc-pascal mailing list