HEX
Server: LiteSpeed
System: Linux us-phx-web1284.main-hosting.eu 4.18.0-553.109.1.lve.el8.x86_64 #1 SMP Thu Mar 5 20:23:46 UTC 2026 x86_64
User: u300739242 (300739242)
PHP: 8.2.30
Disabled: system, shell_exec, passthru, mysql_list_dbs, ini_alter, dl, symlink, link, chgrp, leak, popen, apache_child_terminate, virtual, mb_send_mail
Upload Files
File: //opt/alt/alt-nodejs18/root/usr/share/doc/alt-nodejs18-libicu-doc/classLocaleBuilder.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 74.2: icu::LocaleBuilder Class 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="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 74.2
   &#160;<span id="projectnumber">74.2</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.14 -->
<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('',false,false,'search.php','Search');
});
/* @license-end */</script>
<div id="main-nav"></div>
<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="namespaceicu.html">icu</a></li><li class="navelem"><a class="el" href="classicu_1_1LocaleBuilder.html">LocaleBuilder</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#friends">Friends</a>  </div>
  <div class="headertitle">
<div class="title">icu::LocaleBuilder Class Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p><code><a class="el" href="classicu_1_1LocaleBuilder.html" title="LocaleBuilder is used to build instances of Locale from values configured by the setters. ">LocaleBuilder</a></code> is used to build instances of <code><a class="el" href="classicu_1_1Locale.html" title="A Locale object represents a specific geographical, political, or cultural region. ">Locale</a></code> from values configured by the setters.  
 <a href="classicu_1_1LocaleBuilder.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="localebuilder_8h_source.html">localebuilder.h</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for icu::LocaleBuilder:</div>
<div class="dyncontent">
 <div class="center">
  <img src="classicu_1_1LocaleBuilder.png" usemap="#icu::LocaleBuilder_map" alt=""/>
  <map id="icu::LocaleBuilder_map" name="icu::LocaleBuilder_map">
<area href="classicu_1_1UObject.html" title="UObject is the common ICU &quot;boilerplate&quot; class. " alt="icu::UObject" shape="rect" coords="0,56,113,80"/>
<area href="classicu_1_1UMemory.html" title="UMemory is the common ICU base class. " alt="icu::UMemory" shape="rect" coords="0,0,113,24"/>
</map>
 </div></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:ac35d857f70c6a7d2b1300fd05c723577"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classicu_1_1LocaleBuilder.html#ac35d857f70c6a7d2b1300fd05c723577">LocaleBuilder</a> ()</td></tr>
<tr class="memdesc:ac35d857f70c6a7d2b1300fd05c723577"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructs an empty <a class="el" href="classicu_1_1LocaleBuilder.html" title="LocaleBuilder is used to build instances of Locale from values configured by the setters. ">LocaleBuilder</a>.  <a href="#ac35d857f70c6a7d2b1300fd05c723577">More...</a><br /></td></tr>
<tr class="separator:ac35d857f70c6a7d2b1300fd05c723577"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aafe4cbed041762069c08696009332dbe"><td class="memItemLeft" align="right" valign="top">virtual&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classicu_1_1LocaleBuilder.html#aafe4cbed041762069c08696009332dbe">~LocaleBuilder</a> ()</td></tr>
<tr class="memdesc:aafe4cbed041762069c08696009332dbe"><td class="mdescLeft">&#160;</td><td class="mdescRight">Destructor.  <a href="#aafe4cbed041762069c08696009332dbe">More...</a><br /></td></tr>
<tr class="separator:aafe4cbed041762069c08696009332dbe"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5592724aff641c919bba69a641affa80"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classicu_1_1LocaleBuilder.html">LocaleBuilder</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classicu_1_1LocaleBuilder.html#a5592724aff641c919bba69a641affa80">setLocale</a> (const <a class="el" href="classicu_1_1Locale.html">Locale</a> &amp;locale)</td></tr>
<tr class="memdesc:a5592724aff641c919bba69a641affa80"><td class="mdescLeft">&#160;</td><td class="mdescRight">Resets the <code><a class="el" href="classicu_1_1LocaleBuilder.html" title="LocaleBuilder is used to build instances of Locale from values configured by the setters. ">LocaleBuilder</a></code> to match the provided <code>locale</code>.  <a href="#a5592724aff641c919bba69a641affa80">More...</a><br /></td></tr>
<tr class="separator:a5592724aff641c919bba69a641affa80"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0cc75804f7cf2e3e486e173144a9b2a7"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classicu_1_1LocaleBuilder.html">LocaleBuilder</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classicu_1_1LocaleBuilder.html#a0cc75804f7cf2e3e486e173144a9b2a7">setLanguageTag</a> (<a class="el" href="classicu_1_1StringPiece.html">StringPiece</a> tag)</td></tr>
<tr class="memdesc:a0cc75804f7cf2e3e486e173144a9b2a7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Resets the <a class="el" href="classicu_1_1LocaleBuilder.html" title="LocaleBuilder is used to build instances of Locale from values configured by the setters. ">LocaleBuilder</a> to match the provided IETF BCP 47 language tag.  <a href="#a0cc75804f7cf2e3e486e173144a9b2a7">More...</a><br /></td></tr>
<tr class="separator:a0cc75804f7cf2e3e486e173144a9b2a7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1f306ccd1c42bd92bd27faafa70038c0"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classicu_1_1LocaleBuilder.html">LocaleBuilder</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classicu_1_1LocaleBuilder.html#a1f306ccd1c42bd92bd27faafa70038c0">setLanguage</a> (<a class="el" href="classicu_1_1StringPiece.html">StringPiece</a> language)</td></tr>
<tr class="memdesc:a1f306ccd1c42bd92bd27faafa70038c0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the language.  <a href="#a1f306ccd1c42bd92bd27faafa70038c0">More...</a><br /></td></tr>
<tr class="separator:a1f306ccd1c42bd92bd27faafa70038c0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac6c923b3680080d50a621be42250ea30"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classicu_1_1LocaleBuilder.html">LocaleBuilder</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classicu_1_1LocaleBuilder.html#ac6c923b3680080d50a621be42250ea30">setScript</a> (<a class="el" href="classicu_1_1StringPiece.html">StringPiece</a> script)</td></tr>
<tr class="memdesc:ac6c923b3680080d50a621be42250ea30"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the script.  <a href="#ac6c923b3680080d50a621be42250ea30">More...</a><br /></td></tr>
<tr class="separator:ac6c923b3680080d50a621be42250ea30"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a72397f79251eac46103d1f384019819e"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classicu_1_1LocaleBuilder.html">LocaleBuilder</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classicu_1_1LocaleBuilder.html#a72397f79251eac46103d1f384019819e">setRegion</a> (<a class="el" href="classicu_1_1StringPiece.html">StringPiece</a> region)</td></tr>
<tr class="memdesc:a72397f79251eac46103d1f384019819e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the region.  <a href="#a72397f79251eac46103d1f384019819e">More...</a><br /></td></tr>
<tr class="separator:a72397f79251eac46103d1f384019819e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1393d3e524d05a887d81fca781ee7c95"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classicu_1_1LocaleBuilder.html">LocaleBuilder</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classicu_1_1LocaleBuilder.html#a1393d3e524d05a887d81fca781ee7c95">setVariant</a> (<a class="el" href="classicu_1_1StringPiece.html">StringPiece</a> variant)</td></tr>
<tr class="memdesc:a1393d3e524d05a887d81fca781ee7c95"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the variant.  <a href="#a1393d3e524d05a887d81fca781ee7c95">More...</a><br /></td></tr>
<tr class="separator:a1393d3e524d05a887d81fca781ee7c95"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8c8417c3cb74b244f775a7c28360ad1d"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classicu_1_1LocaleBuilder.html">LocaleBuilder</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classicu_1_1LocaleBuilder.html#a8c8417c3cb74b244f775a7c28360ad1d">setExtension</a> (char key, <a class="el" href="classicu_1_1StringPiece.html">StringPiece</a> value)</td></tr>
<tr class="memdesc:a8c8417c3cb74b244f775a7c28360ad1d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the extension for the given key.  <a href="#a8c8417c3cb74b244f775a7c28360ad1d">More...</a><br /></td></tr>
<tr class="separator:a8c8417c3cb74b244f775a7c28360ad1d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ade28d4e7397898ee1286d90a8e401b9a"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classicu_1_1LocaleBuilder.html">LocaleBuilder</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classicu_1_1LocaleBuilder.html#ade28d4e7397898ee1286d90a8e401b9a">setUnicodeLocaleKeyword</a> (<a class="el" href="classicu_1_1StringPiece.html">StringPiece</a> key, <a class="el" href="classicu_1_1StringPiece.html">StringPiece</a> type)</td></tr>
<tr class="memdesc:ade28d4e7397898ee1286d90a8e401b9a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the Unicode locale keyword type for the given key.  <a href="#ade28d4e7397898ee1286d90a8e401b9a">More...</a><br /></td></tr>
<tr class="separator:ade28d4e7397898ee1286d90a8e401b9a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a34f7dafd752f6b20a800ab0885cf991a"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classicu_1_1LocaleBuilder.html">LocaleBuilder</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classicu_1_1LocaleBuilder.html#a34f7dafd752f6b20a800ab0885cf991a">addUnicodeLocaleAttribute</a> (<a class="el" href="classicu_1_1StringPiece.html">StringPiece</a> attribute)</td></tr>
<tr class="memdesc:a34f7dafd752f6b20a800ab0885cf991a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Adds a unicode locale attribute, if not already present, otherwise has no effect.  <a href="#a34f7dafd752f6b20a800ab0885cf991a">More...</a><br /></td></tr>
<tr class="separator:a34f7dafd752f6b20a800ab0885cf991a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a845c068a8ed85e1ae17fc2fa39cbcc31"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classicu_1_1LocaleBuilder.html">LocaleBuilder</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classicu_1_1LocaleBuilder.html#a845c068a8ed85e1ae17fc2fa39cbcc31">removeUnicodeLocaleAttribute</a> (<a class="el" href="classicu_1_1StringPiece.html">StringPiece</a> attribute)</td></tr>
<tr class="memdesc:a845c068a8ed85e1ae17fc2fa39cbcc31"><td class="mdescLeft">&#160;</td><td class="mdescRight">Removes a unicode locale attribute, if present, otherwise has no effect.  <a href="#a845c068a8ed85e1ae17fc2fa39cbcc31">More...</a><br /></td></tr>
<tr class="separator:a845c068a8ed85e1ae17fc2fa39cbcc31"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aac79ba36b0edb1542f4e0c72c5e3f3f2"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classicu_1_1LocaleBuilder.html">LocaleBuilder</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classicu_1_1LocaleBuilder.html#aac79ba36b0edb1542f4e0c72c5e3f3f2">clear</a> ()</td></tr>
<tr class="memdesc:aac79ba36b0edb1542f4e0c72c5e3f3f2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Resets the builder to its initial, empty state.  <a href="#aac79ba36b0edb1542f4e0c72c5e3f3f2">More...</a><br /></td></tr>
<tr class="separator:aac79ba36b0edb1542f4e0c72c5e3f3f2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3c050cb7eee4636b6840c04a6e4493fd"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classicu_1_1LocaleBuilder.html">LocaleBuilder</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classicu_1_1LocaleBuilder.html#a3c050cb7eee4636b6840c04a6e4493fd">clearExtensions</a> ()</td></tr>
<tr class="memdesc:a3c050cb7eee4636b6840c04a6e4493fd"><td class="mdescLeft">&#160;</td><td class="mdescRight">Resets the extensions to their initial, empty state.  <a href="#a3c050cb7eee4636b6840c04a6e4493fd">More...</a><br /></td></tr>
<tr class="separator:a3c050cb7eee4636b6840c04a6e4493fd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a223a4927091f5179fa213582b871e9c7"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classicu_1_1Locale.html">Locale</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classicu_1_1LocaleBuilder.html#a223a4927091f5179fa213582b871e9c7">build</a> (<a class="el" href="utypes_8h.html#a3343c1c8a8377277046774691c98d78c">UErrorCode</a> &amp;status)</td></tr>
<tr class="memdesc:a223a4927091f5179fa213582b871e9c7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns an instance of <code><a class="el" href="classicu_1_1Locale.html" title="A Locale object represents a specific geographical, political, or cultural region. ">Locale</a></code> created from the fields set on this builder.  <a href="#a223a4927091f5179fa213582b871e9c7">More...</a><br /></td></tr>
<tr class="separator:a223a4927091f5179fa213582b871e9c7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9d0d104591a1f904bd2aeef57c87c0d7"><td class="memItemLeft" align="right" valign="top"><a class="el" href="umachine_8h.html#a349ef00011f20ccd1d3b424445681aa5">UBool</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classicu_1_1LocaleBuilder.html#a9d0d104591a1f904bd2aeef57c87c0d7">copyErrorTo</a> (<a class="el" href="utypes_8h.html#a3343c1c8a8377277046774691c98d78c">UErrorCode</a> &amp;outErrorCode) const</td></tr>
<tr class="memdesc:a9d0d104591a1f904bd2aeef57c87c0d7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the UErrorCode if an error occurred while recording sets.  <a href="#a9d0d104591a1f904bd2aeef57c87c0d7">More...</a><br /></td></tr>
<tr class="separator:a9d0d104591a1f904bd2aeef57c87c0d7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pub_methods_classicu_1_1UObject"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_classicu_1_1UObject')"><img src="closed.png" alt="-"/>&#160;Public Member Functions inherited from <a class="el" href="classicu_1_1UObject.html">icu::UObject</a></td></tr>
<tr class="memitem:af10026497704f510d3d1f2eff50acb18 inherit pub_methods_classicu_1_1UObject"><td class="memItemLeft" align="right" valign="top">virtual&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classicu_1_1UObject.html#af10026497704f510d3d1f2eff50acb18">~UObject</a> ()</td></tr>
<tr class="memdesc:af10026497704f510d3d1f2eff50acb18 inherit pub_methods_classicu_1_1UObject"><td class="mdescLeft">&#160;</td><td class="mdescRight">Destructor.  <a href="classicu_1_1UObject.html#af10026497704f510d3d1f2eff50acb18">More...</a><br /></td></tr>
<tr class="separator:af10026497704f510d3d1f2eff50acb18 inherit pub_methods_classicu_1_1UObject"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aca1169c4978c52ce2b76eda104e9a214 inherit pub_methods_classicu_1_1UObject"><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="uobject_8h.html#a22af10545208a455a6e884008df48e9f">UClassID</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classicu_1_1UObject.html#aca1169c4978c52ce2b76eda104e9a214">getDynamicClassID</a> () const</td></tr>
<tr class="memdesc:aca1169c4978c52ce2b76eda104e9a214 inherit pub_methods_classicu_1_1UObject"><td class="mdescLeft">&#160;</td><td class="mdescRight">ICU4C "poor man's RTTI", returns a UClassID for the actual ICU class.  <a href="classicu_1_1UObject.html#aca1169c4978c52ce2b76eda104e9a214">More...</a><br /></td></tr>
<tr class="separator:aca1169c4978c52ce2b76eda104e9a214 inherit pub_methods_classicu_1_1UObject"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="friends"></a>
Friends</h2></td></tr>
<tr class="memitem:af8d96a98e83a86f462007b7fc9b73b68"><td class="memItemLeft" align="right" valign="top"><a id="af8d96a98e83a86f462007b7fc9b73b68"></a>
class&#160;</td><td class="memItemRight" valign="bottom"><b>LocaleMatcher::Result</b></td></tr>
<tr class="separator:af8d96a98e83a86f462007b7fc9b73b68"><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><code><a class="el" href="classicu_1_1LocaleBuilder.html" title="LocaleBuilder is used to build instances of Locale from values configured by the setters. ">LocaleBuilder</a></code> is used to build instances of <code><a class="el" href="classicu_1_1Locale.html" title="A Locale object represents a specific geographical, political, or cultural region. ">Locale</a></code> from values configured by the setters. </p>
<p>Unlike the <code><a class="el" href="classicu_1_1Locale.html" title="A Locale object represents a specific geographical, political, or cultural region. ">Locale</a></code> constructors, the <code><a class="el" href="classicu_1_1LocaleBuilder.html" title="LocaleBuilder is used to build instances of Locale from values configured by the setters. ">LocaleBuilder</a></code> checks if a value configured by a setter satisfies the syntax requirements defined by the <code><a class="el" href="classicu_1_1Locale.html" title="A Locale object represents a specific geographical, political, or cultural region. ">Locale</a></code> class. A <code><a class="el" href="classicu_1_1Locale.html" title="A Locale object represents a specific geographical, political, or cultural region. ">Locale</a></code> object created by a <code><a class="el" href="classicu_1_1LocaleBuilder.html" title="LocaleBuilder is used to build instances of Locale from values configured by the setters. ">LocaleBuilder</a></code> is well-formed and can be transformed to a well-formed IETF BCP 47 language tag without losing information.</p>
<p>The following example shows how to create a <code><a class="el" href="classicu_1_1Locale.html" title="A Locale object represents a specific geographical, political, or cultural region. ">Locale</a></code> object with the <code><a class="el" href="classicu_1_1LocaleBuilder.html" title="LocaleBuilder is used to build instances of Locale from values configured by the setters. ">LocaleBuilder</a></code>. </p><blockquote class="doxtable">
<pre>
    UErrorCode status = U_ZERO_ERROR;
    <a class="el" href="classicu_1_1Locale.html" title="A Locale object represents a specific geographical, political, or cultural region. ">Locale</a> aLocale = <a class="el" href="classicu_1_1LocaleBuilder.html#ac35d857f70c6a7d2b1300fd05c723577" title="Constructs an empty LocaleBuilder. ">LocaleBuilder()</a>
                         .setLanguage("sr")
                         .setScript("Latn")
                         .setRegion("RS")
                         .build(status);
    if (<a class="el" href="utypes_8h.html#a527f2c69e6b2e3b2c53ad8a99fb36711" title="Does the error code indicate success? ">U_SUCCESS(status)</a>) {
      // ...
    }
</pre> </blockquote>
<p>LocaleBuilders can be reused; <code><a class="el" href="classicu_1_1LocaleBuilder.html#aac79ba36b0edb1542f4e0c72c5e3f3f2" title="Resets the builder to its initial, empty state. ">clear()</a></code> resets all fields to their default values.</p>
<p><a class="el" href="classicu_1_1LocaleBuilder.html" title="LocaleBuilder is used to build instances of Locale from values configured by the setters. ">LocaleBuilder</a> tracks errors in an internal UErrorCode. For all setters, except setLanguageTag and setLocale, <a class="el" href="classicu_1_1LocaleBuilder.html" title="LocaleBuilder is used to build instances of Locale from values configured by the setters. ">LocaleBuilder</a> will return immediately if the internal UErrorCode is in error state. To reset internal state and error code, call clear method. The setLanguageTag and setLocale method will first clear the internal UErrorCode, then track the error of the validation of the input parameter into the internal UErrorCode.</p>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable000286">Stable:</a></b></dt><dd>ICU 64 </dd></dl>

<p class="definition">Definition at line <a class="el" href="localebuilder_8h_source.html#l00061">61</a> of file <a class="el" href="localebuilder_8h_source.html">localebuilder.h</a>.</p>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="ac35d857f70c6a7d2b1300fd05c723577"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac35d857f70c6a7d2b1300fd05c723577">&#9670;&nbsp;</a></span>LocaleBuilder()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">icu::LocaleBuilder::LocaleBuilder </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Constructs an empty <a class="el" href="classicu_1_1LocaleBuilder.html" title="LocaleBuilder is used to build instances of Locale from values configured by the setters. ">LocaleBuilder</a>. </p>
<p>The default value of all fields, extensions, and private use information is the empty string.</p>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable000287">Stable:</a></b></dt><dd>ICU 64 </dd></dl>

</div>
</div>
<a id="aafe4cbed041762069c08696009332dbe"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aafe4cbed041762069c08696009332dbe">&#9670;&nbsp;</a></span>~LocaleBuilder()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual icu::LocaleBuilder::~LocaleBuilder </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Destructor. </p>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable000288">Stable:</a></b></dt><dd>ICU 64 </dd></dl>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="a34f7dafd752f6b20a800ab0885cf991a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a34f7dafd752f6b20a800ab0885cf991a">&#9670;&nbsp;</a></span>addUnicodeLocaleAttribute()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classicu_1_1LocaleBuilder.html">LocaleBuilder</a>&amp; icu::LocaleBuilder::addUnicodeLocaleAttribute </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classicu_1_1StringPiece.html">StringPiece</a>&#160;</td>
          <td class="paramname"><em>attribute</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Adds a unicode locale attribute, if not already present, otherwise has no effect. </p>
<p>The attribute must not be empty string and must be well-formed or U_ILLEGAL_ARGUMENT_ERROR will be set to status during the <a class="el" href="classicu_1_1LocaleBuilder.html#a223a4927091f5179fa213582b871e9c7" title="Returns an instance of Locale created from the fields set on this builder. ">build()</a> call.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">attribute</td><td>the attribute </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>This builder. </dd></dl>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable000297">Stable:</a></b></dt><dd>ICU 64 </dd></dl>

</div>
</div>
<a id="a223a4927091f5179fa213582b871e9c7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a223a4927091f5179fa213582b871e9c7">&#9670;&nbsp;</a></span>build()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classicu_1_1Locale.html">Locale</a> icu::LocaleBuilder::build </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="utypes_8h.html#a3343c1c8a8377277046774691c98d78c">UErrorCode</a> &amp;&#160;</td>
          <td class="paramname"><em>status</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Returns an instance of <code><a class="el" href="classicu_1_1Locale.html" title="A Locale object represents a specific geographical, political, or cultural region. ">Locale</a></code> created from the fields set on this builder. </p>
<p>If any set methods or during the <a class="el" href="classicu_1_1LocaleBuilder.html#a223a4927091f5179fa213582b871e9c7" title="Returns an instance of Locale created from the fields set on this builder. ">build()</a> call require memory allocation but fail U_MEMORY_ALLOCATION_ERROR will be set to status. If any of the fields set by the setters are not well-formed, the status will be set to U_ILLEGAL_ARGUMENT_ERROR. The state of the builder will not change after the <a class="el" href="classicu_1_1LocaleBuilder.html#a223a4927091f5179fa213582b871e9c7" title="Returns an instance of Locale created from the fields set on this builder. ">build()</a> call and the caller is free to keep using the same builder to build more locales.</p>
<dl class="section return"><dt>Returns</dt><dd>a new <a class="el" href="classicu_1_1Locale.html" title="A Locale object represents a specific geographical, political, or cultural region. ">Locale</a> </dd></dl>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable000301">Stable:</a></b></dt><dd>ICU 64 </dd></dl>

</div>
</div>
<a id="aac79ba36b0edb1542f4e0c72c5e3f3f2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aac79ba36b0edb1542f4e0c72c5e3f3f2">&#9670;&nbsp;</a></span>clear()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classicu_1_1LocaleBuilder.html">LocaleBuilder</a>&amp; icu::LocaleBuilder::clear </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Resets the builder to its initial, empty state. </p>
<p>This method clears the internal UErrorCode.</p>
<dl class="section return"><dt>Returns</dt><dd>this builder </dd></dl>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable000299">Stable:</a></b></dt><dd>ICU 64 </dd></dl>

</div>
</div>
<a id="a3c050cb7eee4636b6840c04a6e4493fd"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3c050cb7eee4636b6840c04a6e4493fd">&#9670;&nbsp;</a></span>clearExtensions()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classicu_1_1LocaleBuilder.html">LocaleBuilder</a>&amp; icu::LocaleBuilder::clearExtensions </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Resets the extensions to their initial, empty state. </p>
<p>Language, script, region and variant are unchanged.</p>
<dl class="section return"><dt>Returns</dt><dd>this builder </dd></dl>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable000300">Stable:</a></b></dt><dd>ICU 64 </dd></dl>

</div>
</div>
<a id="a9d0d104591a1f904bd2aeef57c87c0d7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9d0d104591a1f904bd2aeef57c87c0d7">&#9670;&nbsp;</a></span>copyErrorTo()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="umachine_8h.html#a349ef00011f20ccd1d3b424445681aa5">UBool</a> icu::LocaleBuilder::copyErrorTo </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="utypes_8h.html#a3343c1c8a8377277046774691c98d78c">UErrorCode</a> &amp;&#160;</td>
          <td class="paramname"><em>outErrorCode</em></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Sets the UErrorCode if an error occurred while recording sets. </p>
<p>Preserves older error codes in the outErrorCode. </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">outErrorCode</td><td>Set to an error code that occurred while setting subtags. Unchanged if there is no such error or if outErrorCode already contained an error. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>true if <a class="el" href="utypes_8h.html#a4d202200b6aa6f3c965ea370e0c8155f" title="Does the error code indicate a failure? ">U_FAILURE(outErrorCode)</a> </dd></dl>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable000302">Stable:</a></b></dt><dd>ICU 65 </dd></dl>

</div>
</div>
<a id="a845c068a8ed85e1ae17fc2fa39cbcc31"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a845c068a8ed85e1ae17fc2fa39cbcc31">&#9670;&nbsp;</a></span>removeUnicodeLocaleAttribute()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classicu_1_1LocaleBuilder.html">LocaleBuilder</a>&amp; icu::LocaleBuilder::removeUnicodeLocaleAttribute </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classicu_1_1StringPiece.html">StringPiece</a>&#160;</td>
          <td class="paramname"><em>attribute</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Removes a unicode locale attribute, if present, otherwise has no effect. </p>
<p>The attribute must not be empty string and must be well-formed or U_ILLEGAL_ARGUMENT_ERROR will be set to status during the <a class="el" href="classicu_1_1LocaleBuilder.html#a223a4927091f5179fa213582b871e9c7" title="Returns an instance of Locale created from the fields set on this builder. ">build()</a> call.</p>
<p>Attribute comparison for removal is case-insensitive.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">attribute</td><td>the attribute </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>This builder. </dd></dl>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable000298">Stable:</a></b></dt><dd>ICU 64 </dd></dl>

</div>
</div>
<a id="a8c8417c3cb74b244f775a7c28360ad1d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8c8417c3cb74b244f775a7c28360ad1d">&#9670;&nbsp;</a></span>setExtension()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classicu_1_1LocaleBuilder.html">LocaleBuilder</a>&amp; icu::LocaleBuilder::setExtension </td>
          <td>(</td>
          <td class="paramtype">char&#160;</td>
          <td class="paramname"><em>key</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classicu_1_1StringPiece.html">StringPiece</a>&#160;</td>
          <td class="paramname"><em>value</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Sets the extension for the given key. </p>
<p>If the value is the empty string, the extension is removed. Otherwise, the <code>key</code> and <code>value</code> must be well-formed, or else the <a class="el" href="classicu_1_1LocaleBuilder.html#a223a4927091f5179fa213582b871e9c7" title="Returns an instance of Locale created from the fields set on this builder. ">build()</a> method will later report an U_ILLEGAL_ARGUMENT_ERROR.</p>
<p><b>Note:</b> The key ('u') is used for the Unicode locale extension. Setting a value for this key replaces any existing Unicode locale key/type pairs with those defined in the extension.</p>
<p><b>Note:</b> The key ('x') is used for the private use code. To be well-formed, the value for this key needs only to have subtags of one to eight alphanumeric characters, not two to eight as in the general case.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">key</td><td>the extension key </td></tr>
    <tr><td class="paramname">value</td><td>the extension value </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>This builder. </dd></dl>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable000295">Stable:</a></b></dt><dd>ICU 64 </dd></dl>

</div>
</div>
<a id="a1f306ccd1c42bd92bd27faafa70038c0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1f306ccd1c42bd92bd27faafa70038c0">&#9670;&nbsp;</a></span>setLanguage()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classicu_1_1LocaleBuilder.html">LocaleBuilder</a>&amp; icu::LocaleBuilder::setLanguage </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classicu_1_1StringPiece.html">StringPiece</a>&#160;</td>
          <td class="paramname"><em>language</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Sets the language. </p>
<p>If <code>language</code> is the empty string, the language in this <code><a class="el" href="classicu_1_1LocaleBuilder.html" title="LocaleBuilder is used to build instances of Locale from values configured by the setters. ">LocaleBuilder</a></code> is removed. Otherwise, the <code>language</code> must be well-formed, or else the <a class="el" href="classicu_1_1LocaleBuilder.html#a223a4927091f5179fa213582b871e9c7" title="Returns an instance of Locale created from the fields set on this builder. ">build()</a> method will later report an U_ILLEGAL_ARGUMENT_ERROR.</p>
<p>The syntax of language value is defined as <a href="http://www.unicode.org/reports/tr35/tr35.html#unicode_language_subtag">unicode_language_subtag</a>.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">language</td><td>the language </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>This builder. </dd></dl>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable000291">Stable:</a></b></dt><dd>ICU 64 </dd></dl>

</div>
</div>
<a id="a0cc75804f7cf2e3e486e173144a9b2a7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0cc75804f7cf2e3e486e173144a9b2a7">&#9670;&nbsp;</a></span>setLanguageTag()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classicu_1_1LocaleBuilder.html">LocaleBuilder</a>&amp; icu::LocaleBuilder::setLanguageTag </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classicu_1_1StringPiece.html">StringPiece</a>&#160;</td>
          <td class="paramname"><em>tag</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Resets the <a class="el" href="classicu_1_1LocaleBuilder.html" title="LocaleBuilder is used to build instances of Locale from values configured by the setters. ">LocaleBuilder</a> to match the provided IETF BCP 47 language tag. </p>
<p>Discards the existing state. The empty string causes the builder to be reset, like <a class="el" href="classicu_1_1LocaleBuilder.html#aac79ba36b0edb1542f4e0c72c5e3f3f2">clear</a>. Legacy language tags (marked as “Type: grandfathered” in BCP 47) are converted to their canonical form before being processed. Otherwise, the <code>language tag</code> must be well-formed, or else the <a class="el" href="classicu_1_1LocaleBuilder.html#a223a4927091f5179fa213582b871e9c7" title="Returns an instance of Locale created from the fields set on this builder. ">build()</a> method will later report an U_ILLEGAL_ARGUMENT_ERROR.</p>
<p>This method clears the internal UErrorCode.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">tag</td><td>the language tag, defined as IETF BCP 47 language tag. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>This builder. </dd></dl>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable000290">Stable:</a></b></dt><dd>ICU 64 </dd></dl>

</div>
</div>
<a id="a5592724aff641c919bba69a641affa80"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5592724aff641c919bba69a641affa80">&#9670;&nbsp;</a></span>setLocale()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classicu_1_1LocaleBuilder.html">LocaleBuilder</a>&amp; icu::LocaleBuilder::setLocale </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classicu_1_1Locale.html">Locale</a> &amp;&#160;</td>
          <td class="paramname"><em>locale</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Resets the <code><a class="el" href="classicu_1_1LocaleBuilder.html" title="LocaleBuilder is used to build instances of Locale from values configured by the setters. ">LocaleBuilder</a></code> to match the provided <code>locale</code>. </p>
<p>Existing state is discarded.</p>
<p>All fields of the locale must be well-formed. </p>
<p>This method clears the internal UErrorCode.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">locale</td><td>the locale </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>This builder.</dd></dl>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable000289">Stable:</a></b></dt><dd>ICU 64 </dd></dl>

</div>
</div>
<a id="a72397f79251eac46103d1f384019819e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a72397f79251eac46103d1f384019819e">&#9670;&nbsp;</a></span>setRegion()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classicu_1_1LocaleBuilder.html">LocaleBuilder</a>&amp; icu::LocaleBuilder::setRegion </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classicu_1_1StringPiece.html">StringPiece</a>&#160;</td>
          <td class="paramname"><em>region</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Sets the region. </p>
<p>If region is the empty string, the region in this <code><a class="el" href="classicu_1_1LocaleBuilder.html" title="LocaleBuilder is used to build instances of Locale from values configured by the setters. ">LocaleBuilder</a></code> is removed. Otherwise, the <code>region</code> must be well-formed, or else the <a class="el" href="classicu_1_1LocaleBuilder.html#a223a4927091f5179fa213582b871e9c7" title="Returns an instance of Locale created from the fields set on this builder. ">build()</a> method will later report an U_ILLEGAL_ARGUMENT_ERROR.</p>
<p>The region value is defined by <a href="http://www.unicode.org/reports/tr35/tr35.html#unicode_region_subtag">unicode_region_subtag</a> as a two-letter ISO 3166 code or a three-digit UN M.49 area code.</p>
<p>The region value in the <code><a class="el" href="classicu_1_1Locale.html" title="A Locale object represents a specific geographical, political, or cultural region. ">Locale</a></code> created by the <code><a class="el" href="classicu_1_1LocaleBuilder.html" title="LocaleBuilder is used to build instances of Locale from values configured by the setters. ">LocaleBuilder</a></code> is always normalized to upper case.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">region</td><td>the region </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>This builder. </dd></dl>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable000293">Stable:</a></b></dt><dd>ICU 64 </dd></dl>

</div>
</div>
<a id="ac6c923b3680080d50a621be42250ea30"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac6c923b3680080d50a621be42250ea30">&#9670;&nbsp;</a></span>setScript()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classicu_1_1LocaleBuilder.html">LocaleBuilder</a>&amp; icu::LocaleBuilder::setScript </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classicu_1_1StringPiece.html">StringPiece</a>&#160;</td>
          <td class="paramname"><em>script</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Sets the script. </p>
<p>If <code>script</code> is the empty string, the script in this <code><a class="el" href="classicu_1_1LocaleBuilder.html" title="LocaleBuilder is used to build instances of Locale from values configured by the setters. ">LocaleBuilder</a></code> is removed. Otherwise, the <code>script</code> must be well-formed, or else the <a class="el" href="classicu_1_1LocaleBuilder.html#a223a4927091f5179fa213582b871e9c7" title="Returns an instance of Locale created from the fields set on this builder. ">build()</a> method will later report an U_ILLEGAL_ARGUMENT_ERROR.</p>
<p>The script value is a four-letter script code as <a href="http://www.unicode.org/reports/tr35/tr35.html#unicode_script_subtag">unicode_script_subtag</a> defined by ISO 15924</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">script</td><td>the script </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>This builder. </dd></dl>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable000292">Stable:</a></b></dt><dd>ICU 64 </dd></dl>

</div>
</div>
<a id="ade28d4e7397898ee1286d90a8e401b9a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ade28d4e7397898ee1286d90a8e401b9a">&#9670;&nbsp;</a></span>setUnicodeLocaleKeyword()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classicu_1_1LocaleBuilder.html">LocaleBuilder</a>&amp; icu::LocaleBuilder::setUnicodeLocaleKeyword </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classicu_1_1StringPiece.html">StringPiece</a>&#160;</td>
          <td class="paramname"><em>key</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classicu_1_1StringPiece.html">StringPiece</a>&#160;</td>
          <td class="paramname"><em>type</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Sets the Unicode locale keyword type for the given key. </p>
<p>If the type <a class="el" href="classicu_1_1StringPiece.html" title="A string-like object that points to a sized piece of memory. ">StringPiece</a> is constructed with a nullptr, the keyword is removed. If the type is the empty string, the keyword is set without type subtags. Otherwise, the key and type must be well-formed, or else the <a class="el" href="classicu_1_1LocaleBuilder.html#a223a4927091f5179fa213582b871e9c7" title="Returns an instance of Locale created from the fields set on this builder. ">build()</a> method will later report an U_ILLEGAL_ARGUMENT_ERROR.</p>
<p>Keys and types are converted to lower case.</p>
<p><b>Note</b>:Setting the 'u' extension via <a class="el" href="classicu_1_1LocaleBuilder.html#a8c8417c3cb74b244f775a7c28360ad1d">setExtension</a> replaces all Unicode locale keywords with those defined in the extension.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">key</td><td>the Unicode locale key </td></tr>
    <tr><td class="paramname">type</td><td>the Unicode locale type </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>This builder. </dd></dl>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable000296">Stable:</a></b></dt><dd>ICU 64 </dd></dl>

</div>
</div>
<a id="a1393d3e524d05a887d81fca781ee7c95"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1393d3e524d05a887d81fca781ee7c95">&#9670;&nbsp;</a></span>setVariant()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classicu_1_1LocaleBuilder.html">LocaleBuilder</a>&amp; icu::LocaleBuilder::setVariant </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classicu_1_1StringPiece.html">StringPiece</a>&#160;</td>
          <td class="paramname"><em>variant</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Sets the variant. </p>
<p>If variant is the empty string, the variant in this <code><a class="el" href="classicu_1_1LocaleBuilder.html" title="LocaleBuilder is used to build instances of Locale from values configured by the setters. ">LocaleBuilder</a></code> is removed. Otherwise, the <code>variant</code> must be well-formed, or else the <a class="el" href="classicu_1_1LocaleBuilder.html#a223a4927091f5179fa213582b871e9c7" title="Returns an instance of Locale created from the fields set on this builder. ">build()</a> method will later report an U_ILLEGAL_ARGUMENT_ERROR.</p>
<p><b>Note:</b> This method checks if <code>variant</code> satisfies the <a href="http://www.unicode.org/reports/tr35/tr35.html#unicode_variant_subtag">unicode_variant_subtag</a> syntax requirements, and normalizes the value to lowercase letters. However, the <code><a class="el" href="classicu_1_1Locale.html" title="A Locale object represents a specific geographical, political, or cultural region. ">Locale</a></code> class does not impose any syntactic restriction on variant. To set an ill-formed variant, use a <a class="el" href="classicu_1_1Locale.html" title="A Locale object represents a specific geographical, political, or cultural region. ">Locale</a> constructor. If there are multiple unicode_variant_subtag, the caller must concatenate them with '-' as separator (ex: "foobar-fibar").</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">variant</td><td>the variant </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>This builder. </dd></dl>
<dl class="stable"><dt><b><a class="el" href="stable.html#_stable000294">Stable:</a></b></dt><dd>ICU 64 </dd></dl>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>common/unicode/<a class="el" href="localebuilder_8h_source.html">localebuilder.h</a></li>
</ul>
</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>