Changeset 21772 in webkit


Ignore:
Timestamp:
May 25, 2007 12:34:58 PM (17 years ago)
Author:
yongjzha
Message:

2007-05-23 malaiya,

reviewed by Yongjun
DESC: disabled 'SUPPORT_UTF8'flag support in prce
http://bugs.webkit.org/show_bug.cgi?id=13847
TSW ID : ELWI-6Z2AAU


  • pcre/pcre-config.h:
  • pcre/pcre.c: (pcre_compile):
Location:
S60/trunk/JavaScriptCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • S60/trunk/JavaScriptCore/ChangeLog

    r21644 r21772  
     12007-05-23  malaiya,
     2        reviewed by Yongjun
     3        DESC: disabled 'SUPPORT_UTF8'flag support in prce
     4        http://bugs.webkit.org/show_bug.cgi?id=13847
     5        TSW ID : ELWI-6Z2AAU
     6       
     7        * pcre/pcre-config.h:
     8        * pcre/pcre.c:
     9        (pcre_compile):
     10
    1112007-05-22  bujtas  <zbujtas@gmail.com>
    212
  • S60/trunk/JavaScriptCore/pcre/pcre-config.h

    r20905 r21772  
    33#define HAVE_STRERROR 1
    44#define NEWLINE 10
    5 #define SUPPORT_UTF8 0
     5//#define SUPPORT_UTF8 0
  • S60/trunk/JavaScriptCore/pcre/pcre.c

    r21644 r21772  
    209209
    210210#ifndef SUPPORT_UTF8
    211 #define GETCHARINC(c, eptr) c = *eptr++;
    212 #define GETCHARLEN(c, eptr, len) c = *eptr;
    213 #define BACKCHAR(eptr)
    214 
    215 #else   /* SUPPORT_UTF8 */
    216 
    217211#if PCRE_UTF16
    218 
    219212/* Get the next UTF-16 character, advancing the pointer */
    220 
    221213#define LEAD_OFFSET (0xd800 - (0x10000 >> 10))
    222214#define SURROGATE_OFFSET (0x10000 - (0xd800 << 10) - 0xdc00)
     
    250242#define ISMIDCHAR(c) IS_TRAILING_SURROGATE(c)
    251243
    252 #else
    253 
     244#else /* PCRE_UTF16 */
     245#define GETCHARINC(c, eptr) c = *eptr++;
     246#define GETCHARLEN(c, eptr, len) c = *eptr;
     247#endif /* PCRE_UTF16 */
     248#define BACKCHAR(eptr)
     249
     250#else   /* SUPPORT_UTF8 */
     251
     252#if PCRE_UTF16
     253/* Get the next UTF-16 character, advancing the pointer */
     254#define LEAD_OFFSET (0xd800 - (0x10000 >> 10))
     255#define SURROGATE_OFFSET (0x10000 - (0xd800 << 10) - 0xdc00)
     256
     257#define IS_LEADING_SURROGATE(c) (((c) & ~0x3ff) == 0xd800)
     258#define IS_TRAILING_SURROGATE(c) (((c) & ~0x3ff) == 0xdc00)
     259
     260#define DECODE_SURROGATE_PAIR(l, t) (((l) << 10) + (t) + SURROGATE_OFFSET)
     261#define LEADING_SURROGATE(c) (LEAD_OFFSET + ((c) >> 10))
     262#define TRAILING_SURROGATE(c) (0xdc00 + ((c) & 0x3FF))
     263
     264#define GETCHARINC(c, eptr) \
     265  c = *eptr++; \
     266  if (IS_LEADING_SURROGATE(c)) \
     267    c = DECODE_SURROGATE_PAIR(c, *eptr++);
     268
     269/* Get the next UTF-16 character, not advancing the pointer, setting length */
     270
     271#define GETCHARLEN(c, eptr, len) \
     272  c = *eptr; \
     273  if (!IS_LEADING_SURROGATE(c)) \
     274    len = 1; \
     275  else \
     276    { \
     277    c = DECODE_SURROGATE_PAIR(c, eptr[1]); \
     278    len = 2; \
     279    }
     280
     281/* Return 1 if not the start of a character. */
     282
     283#define ISMIDCHAR(c) IS_TRAILING_SURROGATE(c)
     284
     285#else /* PCRE_UTF16 */
    254286/* Get the next UTF-8 character, advancing the pointer */
    255 
    256287#define GETCHARINC(c, eptr) \
    257288  c = *eptr++; \
     
    291322#define ISMIDCHAR(c) (((c) & 0xc0) == 0x80)
    292323
    293 #endif
    294 
     324#endif /* PCRE_UTF16 */
    295325/* If the pointer is not at the start of a character, move it back until
    296326it is. */
    297 
    298327#define BACKCHAR(eptr) while(ISMIDCHAR(*eptr)) eptr--;
    299 
    300 #endif
     328#endif /* SUPPORT_UTF8 */
     329
    301330
    302331
     
    318347#endif
    319348
    320 
    321 
    322 
    323 #if !PCRE_UTF16
    324349#ifdef SUPPORT_UTF8
    325350/*************************************************
     
    378403return i + 1;
    379404}
    380 #endif
    381 #endif
    382 
     405#endif /* SUPPORT_UTF8 */
    383406
    384407
     
    26402663#endif
    26412664
     2665#if !NOKIA_CHANGES
    26422666/* Can't support UTF8 unless PCRE has been compiled to include the code. */
    2643 
    26442667#ifndef SUPPORT_UTF8
    2645 if ((options & PCRE_UTF8) != 0)
     2668if ((options & PCRE_UTF8) != 0) 
    26462669  {
    26472670  *errorptr = ERR32;
     
    26512674
    26522675/* Always set the UTF-8 flag if we're compiled for UTF-16; saves on ifdefs. */
    2653 
    26542676#if PCRE_UTF16
    26552677options |= PCRE_UTF8;
    26562678#endif
     2679#endif //NOKIA_CHANGES
    26572680
    26582681/* We can't pass back an error message if errorptr is NULL; I guess the best we
Note: See TracChangeset for help on using the changeset viewer.