HEX
Server: LiteSpeed
System: Linux s3604.bom1.stableserver.net 4.18.0-513.11.1.lve.el8.x86_64 #1 SMP Thu Jan 18 16:21:02 UTC 2024 x86_64
User: dmstechonline (1480)
PHP: 7.4.33
Disabled: NONE
Upload Files
File: //opt/alt/alt-nodejs24/root/usr/share/doc/alt-nodejs24-libicu-doc/localematcher_8h.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.14"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>ICU 77.1: common/unicode/localematcher.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">ICU 77.1
   &#160;<span id="projectnumber">77.1</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.14 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_bdd9a5d540de89e9fe90efdfc6973a4f.html">common</a></li><li class="navelem"><a class="el" href="dir_f59c6450ff718ff1b085cfd1c36acbd7.html">unicode</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#nested-classes">Data Structures</a> &#124;
<a href="#namespaces">Namespaces</a> &#124;
<a href="#enum-members">Enumerations</a>  </div>
  <div class="headertitle">
<div class="title">localematcher.h File Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>C++ API: Locale matcher: User's desired locales vs.  
<a href="#details">More...</a></p>
<div class="textblock"><code>#include &quot;<a class="el" href="utypes_8h_source.html">unicode/utypes.h</a>&quot;</code><br />
<code>#include &lt;optional&gt;</code><br />
<code>#include &quot;<a class="el" href="locid_8h_source.html">unicode/locid.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="stringpiece_8h_source.html">unicode/stringpiece.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="uobject_8h_source.html">unicode/uobject.h</a>&quot;</code><br />
</div>
<p><a href="localematcher_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Data Structures</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classicu_1_1LocaleMatcher.html">icu::LocaleMatcher</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Immutable class that picks the best match between a user's desired locales and an application's supported locales.  <a href="classicu_1_1LocaleMatcher.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classicu_1_1LocaleMatcher_1_1Result.html">icu::LocaleMatcher::Result</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Data for the best-matching pair of a desired and a supported locale.  <a href="classicu_1_1LocaleMatcher_1_1Result.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classicu_1_1LocaleMatcher_1_1Builder.html">icu::LocaleMatcher::Builder</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight"><a class="el" href="classicu_1_1LocaleMatcher.html" title="Immutable class that picks the best match between a user&#39;s desired locales and an application&#39;s suppo...">LocaleMatcher</a> builder.  <a href="classicu_1_1LocaleMatcher_1_1Builder.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="namespaces"></a>
Namespaces</h2></td></tr>
<tr class="memitem:namespaceicu"><td class="memItemLeft" align="right" valign="top"> &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespaceicu.html">icu</a></td></tr>
<tr class="memdesc:namespaceicu"><td class="mdescLeft">&#160;</td><td class="mdescRight">File <a class="el" href="coll_8h.html" title="C++ API: Collation Service. ">coll.h</a>. <br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="enum-members"></a>
Enumerations</h2></td></tr>
<tr class="memitem:ac0c6ffd0794fa293563f9e44532d9a74"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="localematcher_8h.html#ac0c6ffd0794fa293563f9e44532d9a74">ULocMatchFavorSubtag</a> { <a class="el" href="localematcher_8h.html#ac0c6ffd0794fa293563f9e44532d9a74af4ad3847715ae3452831875e0396928d">ULOCMATCH_FAVOR_LANGUAGE</a>, 
<a class="el" href="localematcher_8h.html#ac0c6ffd0794fa293563f9e44532d9a74a4f596352386d783df1490eb6ba38713a">ULOCMATCH_FAVOR_SCRIPT</a>
 }</td></tr>
<tr class="memdesc:ac0c6ffd0794fa293563f9e44532d9a74"><td class="mdescLeft">&#160;</td><td class="mdescRight">Builder option for whether the language subtag or the script subtag is most important.  <a href="localematcher_8h.html#ac0c6ffd0794fa293563f9e44532d9a74">More...</a><br /></td></tr>
<tr class="separator:ac0c6ffd0794fa293563f9e44532d9a74"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6a6d01604c7b22789bff287433b020f2"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="localematcher_8h.html#a6a6d01604c7b22789bff287433b020f2">ULocMatchDemotion</a> { <a class="el" href="localematcher_8h.html#a6a6d01604c7b22789bff287433b020f2a59f78d1a68b0550b52a1a6720e9357f7">ULOCMATCH_DEMOTION_NONE</a>, 
<a class="el" href="localematcher_8h.html#a6a6d01604c7b22789bff287433b020f2a382d3e5b743091baa307924a865f5737">ULOCMATCH_DEMOTION_REGION</a>
 }</td></tr>
<tr class="memdesc:a6a6d01604c7b22789bff287433b020f2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Builder option for whether all desired locales are treated equally or earlier ones are preferred.  <a href="localematcher_8h.html#a6a6d01604c7b22789bff287433b020f2">More...</a><br /></td></tr>
<tr class="separator:a6a6d01604c7b22789bff287433b020f2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aab5631d903b418f749a3c2f74eaa6455"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="localematcher_8h.html#aab5631d903b418f749a3c2f74eaa6455">ULocMatchDirection</a> { <a class="el" href="localematcher_8h.html#aab5631d903b418f749a3c2f74eaa6455a8dacff75d7d8b7342efe6f73627c5c49">ULOCMATCH_DIRECTION_WITH_ONE_WAY</a>, 
<a class="el" href="localematcher_8h.html#aab5631d903b418f749a3c2f74eaa6455a62ced1eb9f15a0ca3a62c071ed227552">ULOCMATCH_DIRECTION_ONLY_TWO_WAY</a>
 }</td></tr>
<tr class="memdesc:aab5631d903b418f749a3c2f74eaa6455"><td class="mdescLeft">&#160;</td><td class="mdescRight">Builder option for whether to include or ignore one-way (fallback) match data.  <a href="localematcher_8h.html#aab5631d903b418f749a3c2f74eaa6455">More...</a><br /></td></tr>
<tr class="separator:aab5631d903b418f749a3c2f74eaa6455"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>C++ API: Locale matcher: User's desired locales vs. </p>
<p>application's supported locales. </p>

<p class="definition">Definition in file <a class="el" href="localematcher_8h_source.html">localematcher.h</a>.</p>
</div><h2 class="groupheader">Enumeration Type Documentation</h2>
<a id="a6a6d01604c7b22789bff287433b020f2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6a6d01604c7b22789bff287433b020f2">&#9670;&nbsp;</a></span>ULocMatchDemotion</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="localematcher_8h.html#a6a6d01604c7b22789bff287433b020f2">ULocMatchDemotion</a></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Builder option for whether all desired locales are treated equally or earlier ones are preferred. </p>
<dl class="section see"><dt>See also</dt><dd>LocaleMatcher::Builder::setDemotionPerDesiredLocale(ULocMatchDemotion) </dd></dl>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable000304">Stable:</a></b></dt><dd>ICU 65 </dd></dl>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="a6a6d01604c7b22789bff287433b020f2a59f78d1a68b0550b52a1a6720e9357f7"></a>ULOCMATCH_DEMOTION_NONE&#160;</td><td class="fielddoc"><p>All desired locales are treated equally. </p>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable000308">Stable:</a></b></dt><dd>ICU 65 </dd></dl>
</td></tr>
<tr><td class="fieldname"><a id="a6a6d01604c7b22789bff287433b020f2a382d3e5b743091baa307924a865f5737"></a>ULOCMATCH_DEMOTION_REGION&#160;</td><td class="fielddoc"><p>Earlier desired locales are preferred. </p>
<p>From each desired locale to the next, the distance to any supported locale is increased by an additional amount which is at least as large as most region mismatches. A later desired locale has to have a better match with some supported locale due to more than merely having the same region subtag.</p>
<p>For example: <code>Supported={en, sv} desired=[en-GB, sv]</code> yields <code>Result(en-GB, en)</code> because with the demotion of sv its perfect match is no better than the region distance between the earlier desired locale en-GB and en=en-US.</p>
<p>Notes: </p><ul>
<li>
In some cases, language and/or script differences can be as small as the typical region difference. (Example: sr-Latn vs. sr-Cyrl) </li>
<li>
It is possible for certain region differences to be larger than usual, and larger than the demotion. (As of CLDR 35 there is no such case, but this is possible in future versions of the data.) </li>
</ul>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable000309">Stable:</a></b></dt><dd>ICU 65 </dd></dl>
</td></tr>
</table>

<p class="definition">Definition at line <a class="el" href="localematcher_8h_source.html#l00057">57</a> of file <a class="el" href="localematcher_8h_source.html">localematcher.h</a>.</p>

</div>
</div>
<a id="aab5631d903b418f749a3c2f74eaa6455"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aab5631d903b418f749a3c2f74eaa6455">&#9670;&nbsp;</a></span>ULocMatchDirection</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="localematcher_8h.html#aab5631d903b418f749a3c2f74eaa6455">ULocMatchDirection</a></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Builder option for whether to include or ignore one-way (fallback) match data. </p>
<p>The LocaleMatcher uses CLDR languageMatch data which includes fallback (oneway=true) entries. Sometimes it is desirable to ignore those.</p>
<p>For example, consider a web application with the UI in a given language, with a link to another, related web app. The link should include the UI language, and the target server may also use the client’s Accept-Language header data. The target server has its own list of supported languages. One may want to favor UI language consistency, that is, if there is a decent match for the original UI language, we want to use it, but not if it is merely a fallback.</p>
<dl class="section see"><dt>See also</dt><dd>LocaleMatcher::Builder::setDirection(ULocMatchDirection) </dd></dl>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable000305">Stable:</a></b></dt><dd>ICU 67 </dd></dl>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="aab5631d903b418f749a3c2f74eaa6455a8dacff75d7d8b7342efe6f73627c5c49"></a>ULOCMATCH_DIRECTION_WITH_ONE_WAY&#160;</td><td class="fielddoc"><p>Locale matching includes one-way matches such as Breton→French. </p>
<p>(default)</p>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable000310">Stable:</a></b></dt><dd>ICU 67 </dd></dl>
</td></tr>
<tr><td class="fieldname"><a id="aab5631d903b418f749a3c2f74eaa6455a62ced1eb9f15a0ca3a62c071ed227552"></a>ULOCMATCH_DIRECTION_ONLY_TWO_WAY&#160;</td><td class="fielddoc"><p>Locale matching limited to two-way matches including e.g. </p>
<p>Danish↔Norwegian but ignoring one-way matches.</p>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable000311">Stable:</a></b></dt><dd>ICU 67 </dd></dl>
</td></tr>
</table>

<p class="definition">Definition at line <a class="el" href="localematcher_8h_source.html#l00113">113</a> of file <a class="el" href="localematcher_8h_source.html">localematcher.h</a>.</p>

</div>
</div>
<a id="ac0c6ffd0794fa293563f9e44532d9a74"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac0c6ffd0794fa293563f9e44532d9a74">&#9670;&nbsp;</a></span>ULocMatchFavorSubtag</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="localematcher_8h.html#ac0c6ffd0794fa293563f9e44532d9a74">ULocMatchFavorSubtag</a></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Builder option for whether the language subtag or the script subtag is most important. </p>
<dl class="section see"><dt>See also</dt><dd>LocaleMatcher::Builder::setFavorSubtag(ULocMatchFavorSubtag) </dd></dl>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable000303">Stable:</a></b></dt><dd>ICU 65 </dd></dl>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="ac0c6ffd0794fa293563f9e44532d9a74af4ad3847715ae3452831875e0396928d"></a>ULOCMATCH_FAVOR_LANGUAGE&#160;</td><td class="fielddoc"><p>Language differences are most important, then script differences, then region differences. </p>
<p>(This is the default behavior.)</p>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable000306">Stable:</a></b></dt><dd>ICU 65 </dd></dl>
</td></tr>
<tr><td class="fieldname"><a id="ac0c6ffd0794fa293563f9e44532d9a74a4f596352386d783df1490eb6ba38713a"></a>ULOCMATCH_FAVOR_SCRIPT&#160;</td><td class="fielddoc"><p>Makes script differences matter relatively more than language differences. </p>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable000307">Stable:</a></b></dt><dd>ICU 65 </dd></dl>
</td></tr>
</table>

<p class="definition">Definition at line <a class="el" href="localematcher_8h_source.html#l00031">31</a> of file <a class="el" href="localematcher_8h_source.html">localematcher.h</a>.</p>

</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.14
</small></address>
</body>
</html>