EVOLUTION-MANAGER
Edit File: stringi-locale.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Locales and 'stringi'</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for stringi-locale {stringi}"><tr><td>stringi-locale {stringi}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Locales and <span class="pkg">stringi</span></h2> <h3>Description</h3> <p>In this section we explain how we deal with locales in <span class="pkg">stringi</span>. Locale is a fundamental concept in <span class="pkg">ICU</span>. It identifies a specific user community, i.e., a group of users who have similar culture and language expectations for human-computer interaction. </p> <h3>Details</h3> <p>Because a locale is just an identifier of a region, no validity check is performed when you specify a Locale. <span class="pkg">ICU</span> is implemented as a set of services. If you want to verify whether particular resources are available in the locale you asked for, you must query those resources. Note: when you ask for a resource for a particular locale, you get back the best available match, not necessarily precisely the one you requested. </p> <h3>Locale Identifiers</h3> <p><span class="pkg">ICU</span> services are parametrized by locale, to deliver culturally correct results. Locales are identified by character strings of the form <code>Language</code> code, <code>Language_Country</code> code, or <code>Language_Country_Variant</code> code, e.g., "en_US". </p> <p>The two-letter <code>Language</code> code uses the ISO-639-1 standard, e.g., "en" stands for English, "pl" – Polish, "fr" – French, and "de" for German. </p> <p><code>Country</code> is a two-letter code following the ISO-3166 standard. This is to reflect different language conventions within the same language, for example in US-English ("en_US") and Australian-English ("en_AU"). </p> <p>Differences may also appear in language conventions used within the same country. For example, the Euro currency may be used in several European countries while the individual country's currency is still in circulation. In such a case, <span class="pkg">ICU</span> <code>Variant</code> "_EURO" could be used for selecting locales that support the Euro currency. </p> <p>The final (optional) element of a locale is a list of keywords together with their values. Keywords must be unique. Their order is not significant. Unknown keywords are ignored. The handling of keywords depends on the specific services that utilize them. Currently, the following keywords are recognized: <code>calendar</code>, <code>colation</code>, <code>currency</code>, and <code>numbers</code>, e.g., <code>fr@collation=phonebook;</code><code>calendar=islamic-civil</code> is a valid French locale specifier together with keyword arguments. For more information, refer to the ICU user guide. </p> <p>For a list of locales that are recognized by <span class="pkg">ICU</span>, call <code><a href="stri_locale_list.html">stri_locale_list</a></code>. </p> <h3>A Note on Default Locales</h3> <p>Each locale-sensitive function in <span class="pkg">stringi</span> selects the current default locale if an empty string or <code>NULL</code> is provided as its <code>locale</code> argument. Default locales are available to all the functions: they are initially set to be the system locale on that platform, and may be changed with <code><a href="stri_locale_set.html">stri_locale_set</a></code>, for example, if automatic detection fails to recognize your locale properly. </p> <p>It is suggested that your program should avoid changing the default locale. All locale-sensitive functions may request any desired locale per-call (by specifying the <code>locale</code> argument), i.e., without referencing to the default locale. During many tests, however, we did not observe any improper behavior of <span class="pkg">stringi</span> while using a modified default locale. </p> <h3>Locale-Sensitive Functions in <span class="pkg">stringi</span></h3> <p>One of many examples of locale-dependent services is the Collator, which performs a locale-aware string comparison. It is used for string comparing, ordering, sorting, and searching. See <code><a href="stri_opts_collator.html">stri_opts_collator</a></code> for the description on how to tune its settings, and its <code>locale</code> argument in particular. </p> <p>Other locale-sensitive functions include, e.g., <code><a href="stri_trans_casemap.html">stri_trans_tolower</a></code> (that does character case mapping). </p> <h3>References</h3> <p><em>Locale</em> – ICU User Guide, <a href="http://userguide.icu-project.org/locale">http://userguide.icu-project.org/locale</a> </p> <p><em>ISO 639: Language Codes</em>, <a href="http://www.iso.org/iso/home/standards/language_codes.htm">http://www.iso.org/iso/home/standards/language_codes.htm</a> </p> <p><em>ISO 3166: Country Codes</em>, <a href="http://www.iso.org/iso/country_codes">http://www.iso.org/iso/country_codes</a> </p> <h3>See Also</h3> <p>Other locale_management: <code><a href="stri_locale_info.html">stri_locale_info</a>()</code>, <code><a href="stri_locale_list.html">stri_locale_list</a>()</code>, <code><a href="stri_locale_set.html">stri_locale_set</a>()</code> </p> <p>Other locale_sensitive: <code><a href="oper_comparison.html">%s<%</a>()</code>, <code><a href="stri_compare.html">stri_compare</a>()</code>, <code><a href="stri_count_boundaries.html">stri_count_boundaries</a>()</code>, <code><a href="stri_duplicated.html">stri_duplicated</a>()</code>, <code><a href="stri_enc_detect2.html">stri_enc_detect2</a>()</code>, <code><a href="stri_extract_boundaries.html">stri_extract_all_boundaries</a>()</code>, <code><a href="stri_locate_boundaries.html">stri_locate_all_boundaries</a>()</code>, <code><a href="stri_opts_collator.html">stri_opts_collator</a>()</code>, <code><a href="stri_order.html">stri_order</a>()</code>, <code><a href="stri_sort.html">stri_sort</a>()</code>, <code><a href="stri_split_boundaries.html">stri_split_boundaries</a>()</code>, <code><a href="stri_trans_casemap.html">stri_trans_tolower</a>()</code>, <code><a href="stri_unique.html">stri_unique</a>()</code>, <code><a href="stri_wrap.html">stri_wrap</a>()</code>, <code><a href="stringi-search-boundaries.html">stringi-search-boundaries</a></code>, <code><a href="stringi-search-coll.html">stringi-search-coll</a></code> </p> <p>Other stringi_general_topics: <code><a href="stringi-arguments.html">stringi-arguments</a></code>, <code><a href="stringi-encoding.html">stringi-encoding</a></code>, <code><a href="stringi-package.html">stringi-package</a></code>, <code><a href="stringi-search-boundaries.html">stringi-search-boundaries</a></code>, <code><a href="stringi-search-charclass.html">stringi-search-charclass</a></code>, <code><a href="stringi-search-coll.html">stringi-search-coll</a></code>, <code><a href="stringi-search-fixed.html">stringi-search-fixed</a></code>, <code><a href="stringi-search-regex.html">stringi-search-regex</a></code>, <code><a href="stringi-search.html">stringi-search</a></code> </p> <hr /><div style="text-align: center;">[Package <em>stringi</em> version 1.4.6 <a href="00Index.html">Index</a>]</div> </body></html>