/[pcre]/code/trunk/doc/html/pcreapi.html
ViewVC logotype

Diff of /code/trunk/doc/html/pcreapi.html

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

revision 128 by ph10, Tue Mar 20 11:46:50 2007 UTC revision 142 by ph10, Fri Mar 30 15:55:18 2007 UTC
# Line 737  bytes is created. Line 737  bytes is created.
737  <a name="localesupport"></a></P>  <a name="localesupport"></a></P>
738  <br><a name="SEC10" href="#TOC1">LOCALE SUPPORT</a><br>  <br><a name="SEC10" href="#TOC1">LOCALE SUPPORT</a><br>
739  <P>  <P>
740  PCRE handles caseless matching, and determines whether characters are letters  PCRE handles caseless matching, and determines whether characters are letters,
741  digits, or whatever, by reference to a set of tables, indexed by character  digits, or whatever, by reference to a set of tables, indexed by character
742  value. When running in UTF-8 mode, this applies only to characters with codes  value. When running in UTF-8 mode, this applies only to characters with codes
743  less than 128. Higher-valued codes never match escapes such as \w or \d, but  less than 128. Higher-valued codes never match escapes such as \w or \d, but
744  can be tested with \p if PCRE is built with Unicode character property  can be tested with \p if PCRE is built with Unicode character property
745  support. The use of locales with Unicode is discouraged.  support. The use of locales with Unicode is discouraged. If you are handling
746    characters with codes greater than 128, you should either use UTF-8 and
747    Unicode, or use locales, but not try to mix the two.
748  </P>  </P>
749  <P>  <P>
750  An internal set of tables is created in the default C locale when PCRE is  PCRE contains an internal set of tables that are used when the final argument
751  built. This is used when the final argument of <b>pcre_compile()</b> is NULL,  of <b>pcre_compile()</b> is NULL. These are sufficient for many applications.
752  and is sufficient for many applications. An alternative set of tables can,  Normally, the internal tables recognize only ASCII characters. However, when
753  however, be supplied. These may be created in a different locale from the  PCRE is built, it is possible to cause the internal tables to be rebuilt in the
754  default. As more and more applications change to using Unicode, the need for  default "C" locale of the local system, which may cause them to be different.
755  this locale support is expected to die away.  </P>
756    <P>
757    The internal tables can always be overridden by tables supplied by the
758    application that calls PCRE. These may be created in a different locale from
759    the default. As more and more applications change to using Unicode, the need
760    for this locale support is expected to die away.
761  </P>  </P>
762  <P>  <P>
763  External tables are built by calling the <b>pcre_maketables()</b> function,  External tables are built by calling the <b>pcre_maketables()</b> function,
# Line 764  the following code could be used: Line 771  the following code could be used:
771    tables = pcre_maketables();    tables = pcre_maketables();
772    re = pcre_compile(..., tables);    re = pcre_compile(..., tables);
773  </pre>  </pre>
774    The locale name "fr_FR" is used on Linux and other Unix-like systems; if you
775    are using Windows, the name for the French locale is "french".
776    </P>
777    <P>
778  When <b>pcre_maketables()</b> runs, the tables are built in memory that is  When <b>pcre_maketables()</b> runs, the tables are built in memory that is
779  obtained via <b>pcre_malloc</b>. It is the caller's responsibility to ensure  obtained via <b>pcre_malloc</b>. It is the caller's responsibility to ensure
780  that the memory containing the tables remains available for as long as it is  that the memory containing the tables remains available for as long as it is

Legend:
Removed from v.128  
changed lines
  Added in v.142

  ViewVC Help
Powered by ViewVC 1.1.5