/[pcre]/code/trunk/pcre32_valid_utf32.c
ViewVC logotype

Diff of /code/trunk/pcre32_valid_utf32.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1260 by ph10, Sun Oct 21 17:22:30 2012 UTC revision 1261 by ph10, Wed Feb 27 16:27:01 2013 UTC
# Line 6  Line 6 
6  and semantics are as close as possible to those of the Perl 5 language.  and semantics are as close as possible to those of the Perl 5 language.
7    
8                         Written by Philip Hazel                         Written by Philip Hazel
9             Copyright (c) 1997-2012 University of Cambridge             Copyright (c) 1997-2013 University of Cambridge
10    
11  -----------------------------------------------------------------------------  -----------------------------------------------------------------------------
12  Redistribution and use in source and binary forms, with or without  Redistribution and use in source and binary forms, with or without
# Line 66  back in the returned value: Line 66  back in the returned value:
66    
67  PCRE_UTF32_ERR0  No error  PCRE_UTF32_ERR0  No error
68  PCRE_UTF32_ERR1  Surrogate character  PCRE_UTF32_ERR1  Surrogate character
69  PCRE_UTF32_ERR2  Non-character  PCRE_UTF32_ERR2  Unused (was non-character)
70  PCRE_UTF32_ERR3  Character > 0x10ffff  PCRE_UTF32_ERR3  Character > 0x10ffff
71    
72  Arguments:  Arguments:
# Line 98  for (p = string; length-- > 0; p++) Line 98  for (p = string; length-- > 0; p++)
98    if ((c & 0xfffff800u) != 0xd800u)    if ((c & 0xfffff800u) != 0xd800u)
99      {      {
100      /* Normal UTF-32 code point. Neither high nor low surrogate. */      /* Normal UTF-32 code point. Neither high nor low surrogate. */
101        if (c > 0x10ffffu)
     /* Check for non-characters */  
     if ((c & 0xfffeu) == 0xfffeu || (c >= 0xfdd0u && c <= 0xfdefu))  
       {  
       *erroroffset = p - string;  
       return PCRE_UTF32_ERR2;  
       }  
     else if (c > 0x10ffffu)  
102        {        {
103        *erroroffset = p - string;        *erroroffset = p - string;
104        return PCRE_UTF32_ERR3;        return PCRE_UTF32_ERR3;

Legend:
Removed from v.1260  
changed lines
  Added in v.1261

  ViewVC Help
Powered by ViewVC 1.1.5