| 7 |
below for why this module is different). |
below for why this module is different). |
| 8 |
|
|
| 9 |
Written by Philip Hazel |
Written by Philip Hazel |
| 10 |
Copyright (c) 1997-2010 University of Cambridge |
Copyright (c) 1997-2011 University of Cambridge |
| 11 |
|
|
| 12 |
----------------------------------------------------------------------------- |
----------------------------------------------------------------------------- |
| 13 |
Redistribution and use in source and binary forms, with or without |
Redistribution and use in source and binary forms, with or without |
| 2963 |
#ifdef SUPPORT_UTF8 |
#ifdef SUPPORT_UTF8 |
| 2964 |
if (utf8 && (options & PCRE_NO_UTF8_CHECK) == 0) |
if (utf8 && (options & PCRE_NO_UTF8_CHECK) == 0) |
| 2965 |
{ |
{ |
| 2966 |
int tb; |
int errorcode; |
| 2967 |
if ((tb = _pcre_valid_utf8((uschar *)subject, length)) >= 0) |
int tb = _pcre_valid_utf8((uschar *)subject, length, &errorcode); |
| 2968 |
return (tb == length && (options & PCRE_PARTIAL_HARD) != 0)? |
if (tb >= 0) |
| 2969 |
|
{ |
| 2970 |
|
if (offsetcount >= 2) |
| 2971 |
|
{ |
| 2972 |
|
offsets[0] = tb; |
| 2973 |
|
offsets[1] = errorcode; |
| 2974 |
|
} |
| 2975 |
|
return (errorcode <= PCRE_UTF8_ERR5 && (options & PCRE_PARTIAL_HARD) != 0)? |
| 2976 |
PCRE_ERROR_SHORTUTF8 : PCRE_ERROR_BADUTF8; |
PCRE_ERROR_SHORTUTF8 : PCRE_ERROR_BADUTF8; |
| 2977 |
|
} |
| 2978 |
if (start_offset > 0 && start_offset < length) |
if (start_offset > 0 && start_offset < length) |
| 2979 |
{ |
{ |
| 2980 |
tb = ((USPTR)subject)[start_offset] & 0xc0; |
tb = ((USPTR)subject)[start_offset] & 0xc0; |