Patch updated. Paul, thanks for the previous comments. As you suggested, the attached patch doesn't copy the buffer and splits the input when it finds an invalid character. For the moment, I don't see a cleaner way to avoid the pcre internals. Regards, Santiago