[pcre-dev] [Bug 1497] pcre32 documentation was difficult to …

Top Page
Delete this message
Author: Zoltan Herczeg
Date:  
To: pcre-dev
Subject: [pcre-dev] [Bug 1497] pcre32 documentation was difficult to find to solve endianness -problem
------- You are receiving this mail because: -------
You are on the CC list for the bug.

http://bugs.exim.org/show_bug.cgi?id=1497

Zoltan Herczeg <hzmester@???> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |hzmester@???





--- Comment #1 from Zoltan Herczeg <hzmester@???> 2014-06-28 06:00:31 ---
I think the documentation is clear, although you need to read the description
of arguments to fully understand how this function works. So it is not "convert
host programs byte order to pcre byte order". The 32 bit mode always uses the
host byte order because of performance considerations.

The purpose of this utility function: you can get rid of byte order marks
(BOMs). The reason is that these BOMs are not characters, although pcre will
treat them as characters if they are there:

./pcretest -32
PCRE version 8.36-RC1 2014-04-21

re> /./8
data> \x{ffef}

0: \x{ffef}

However, you may want to ignore these characters. This function copy the input
to the output, except BOMs (can be an in-place copy). As a bonus, it also swaps
the endianness of all non-BOM characters, if the last BOM was in other
endianness (the input can contain any number of BOMs).

I hope this helps.


--
Configure bugmail: http://bugs.exim.org/userprefs.cgi?tab=email