1 <!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2 <html xmlns=
"http://www.w3.org/1999/xhtml">
4 <meta http-equiv=
"Content-Type" content=
"text/xhtml;charset=UTF-8"/>
5 <meta http-equiv=
"X-UA-Compatible" content=
"IE=9"/>
6 <meta name=
"generator" content=
"Doxygen 1.8.6"/>
7 <title>Boost.Locale: boost::locale::util Namespace Reference
</title>
8 <link href=
"tabs.css" rel=
"stylesheet" type=
"text/css"/>
9 <script type=
"text/javascript" src=
"jquery.js"></script>
10 <script type=
"text/javascript" src=
"dynsections.js"></script>
11 <link href=
"navtree.css" rel=
"stylesheet" type=
"text/css"/>
12 <script type=
"text/javascript" src=
"resize.js"></script>
13 <script type=
"text/javascript" src=
"navtree.js"></script>
14 <script type=
"text/javascript">
15 $(document).ready(initResizable);
16 $(window).load(resizeHeight);
18 <link href=
"doxygen.css" rel=
"stylesheet" type=
"text/css" />
21 <div id=
"top"><!-- do not remove this div, it is closed by doxygen! -->
23 <table cellspacing=
"0" cellpadding=
"0">
25 <tr style=
"height: 56px;">
26 <td id=
"projectlogo"><img alt=
"Logo" src=
"boost-small.png"/></td>
27 <td style=
"padding-left: 0.5em;">
28 <div id=
"projectname">Boost.Locale
35 <!-- end header part -->
36 <!-- Generated by Doxygen 1.8.6 -->
37 <div id=
"navrow1" class=
"tabs">
39 <li><a href=
"index.html"><span>Main
 Page
</span></a></li>
40 <li><a href=
"pages.html"><span>Related
 Pages
</span></a></li>
41 <li><a href=
"modules.html"><span>Modules
</span></a></li>
42 <li class=
"current"><a href=
"namespaces.html"><span>Namespaces
</span></a></li>
43 <li><a href=
"annotated.html"><span>Classes
</span></a></li>
44 <li><a href=
"files.html"><span>Files
</span></a></li>
45 <li><a href=
"examples.html"><span>Examples
</span></a></li>
48 <div id=
"navrow2" class=
"tabs2">
50 <li><a href=
"namespaces.html"><span>Namespace
 List
</span></a></li>
51 <li><a href=
"namespacemembers.html"><span>Namespace
 Members
</span></a></li>
55 <div id=
"side-nav" class=
"ui-resizable side-nav-resizable">
57 <div id=
"nav-tree-contents">
58 <div id=
"nav-sync" class=
"sync"></div>
61 <div id=
"splitbar" style=
"-moz-user-select:none;"
62 class=
"ui-resizable-handle">
65 <script type=
"text/javascript">
66 $(document).ready(function(){initNavTree('namespaceboost_1_1locale_1_1util.html','');});
68 <div id=
"doc-content">
71 <a href=
"#nested-classes">Classes
</a> |
72 <a href=
"#func-members">Functions
</a> </div>
73 <div class=
"headertitle">
74 <div class=
"title">boost::locale::util Namespace Reference
</div> </div>
76 <div class=
"contents">
78 <p>This namespace provides various utility function useful for Boost.Locale backends implementations.
79 <a href=
"#details">More...
</a></p>
80 <table class=
"memberdecls">
81 <tr class=
"heading"><td colspan=
"2"><h2 class=
"groupheader"><a name=
"nested-classes"></a>
82 Classes
</h2></td></tr>
83 <tr class=
"memitem:"><td class=
"memItemLeft" align=
"right" valign=
"top">class
 </td><td class=
"memItemRight" valign=
"bottom"><a class=
"el" href=
"classboost_1_1locale_1_1util_1_1base__converter.html">base_converter
</a></td></tr>
84 <tr class=
"memdesc:"><td class=
"mdescLeft"> </td><td class=
"mdescRight">This class represent a simple stateless converter from UCS-
4 and to UCS-
4 for each single code point.
<a href=
"classboost_1_1locale_1_1util_1_1base__converter.html#details">More...
</a><br/></td></tr>
85 <tr class=
"separator:"><td class=
"memSeparator" colspan=
"2"> </td></tr>
86 </table><table class=
"memberdecls">
87 <tr class=
"heading"><td colspan=
"2"><h2 class=
"groupheader"><a name=
"func-members"></a>
88 Functions
</h2></td></tr>
89 <tr class=
"memitem:ad9737569d0e2d6b08885b01aba308365"><td class=
"memItemLeft" align=
"right" valign=
"top">std::string
 </td><td class=
"memItemRight" valign=
"bottom"><a class=
"el" href=
"namespaceboost_1_1locale_1_1util.html#ad9737569d0e2d6b08885b01aba308365">get_system_locale
</a> (bool use_utf8_on_windows=false)
</td></tr>
90 <tr class=
"memdesc:ad9737569d0e2d6b08885b01aba308365"><td class=
"mdescLeft"> </td><td class=
"mdescRight">Return default system locale name in POSIX format.
<a href=
"#ad9737569d0e2d6b08885b01aba308365">More...
</a><br/></td></tr>
91 <tr class=
"separator:ad9737569d0e2d6b08885b01aba308365"><td class=
"memSeparator" colspan=
"2"> </td></tr>
92 <tr class=
"memitem:a8322299021a4af3cdbb8b31e775e77f4"><td class=
"memItemLeft" align=
"right" valign=
"top">std::locale
 </td><td class=
"memItemRight" valign=
"bottom"><a class=
"el" href=
"namespaceboost_1_1locale_1_1util.html#a8322299021a4af3cdbb8b31e775e77f4">create_info
</a> (std::locale const
&in, std::string const
&name)
</td></tr>
93 <tr class=
"memdesc:a8322299021a4af3cdbb8b31e775e77f4"><td class=
"mdescLeft"> </td><td class=
"mdescRight">Installs information facet to locale in based on locale name
<em>name
</em>.
<a href=
"#a8322299021a4af3cdbb8b31e775e77f4">More...
</a><br/></td></tr>
94 <tr class=
"separator:a8322299021a4af3cdbb8b31e775e77f4"><td class=
"memSeparator" colspan=
"2"> </td></tr>
95 <tr class=
"memitem:aa8e8480ddadc3e972aeb4d468446db64"><td class=
"memItemLeft" align=
"right" valign=
"top">std::auto_ptr
< <a class=
"el" href=
"classboost_1_1locale_1_1util_1_1base__converter.html">base_converter
</a> > </td><td class=
"memItemRight" valign=
"bottom"><a class=
"el" href=
"namespaceboost_1_1locale_1_1util.html#aa8e8480ddadc3e972aeb4d468446db64">create_utf8_converter
</a> ()
</td></tr>
96 <tr class=
"separator:aa8e8480ddadc3e972aeb4d468446db64"><td class=
"memSeparator" colspan=
"2"> </td></tr>
97 <tr class=
"memitem:a79624ad8d782ad41d5edf90b6c830631"><td class=
"memItemLeft" align=
"right" valign=
"top">std::auto_ptr
< <a class=
"el" href=
"classboost_1_1locale_1_1util_1_1base__converter.html">base_converter
</a> > </td><td class=
"memItemRight" valign=
"bottom"><a class=
"el" href=
"namespaceboost_1_1locale_1_1util.html#a79624ad8d782ad41d5edf90b6c830631">create_simple_converter
</a> (std::string const
&encoding)
</td></tr>
98 <tr class=
"separator:a79624ad8d782ad41d5edf90b6c830631"><td class=
"memSeparator" colspan=
"2"> </td></tr>
99 <tr class=
"memitem:a3e6728910dc947c3062c6bfd28b70fc4"><td class=
"memItemLeft" align=
"right" valign=
"top">std::locale
 </td><td class=
"memItemRight" valign=
"bottom"><a class=
"el" href=
"namespaceboost_1_1locale_1_1util.html#a3e6728910dc947c3062c6bfd28b70fc4">create_codecvt
</a> (std::locale const
&in, std::auto_ptr
< <a class=
"el" href=
"classboost_1_1locale_1_1util_1_1base__converter.html">base_converter
</a> > cvt,
<a class=
"el" href=
"namespaceboost_1_1locale.html#a8c993aaf15e683e97d062560ccf914d8">character_facet_type
</a> type)
</td></tr>
100 <tr class=
"separator:a3e6728910dc947c3062c6bfd28b70fc4"><td class=
"memSeparator" colspan=
"2"> </td></tr>
101 <tr class=
"memitem:aedf56793c0804295e06cf97300b991f8"><td class=
"memItemLeft" align=
"right" valign=
"top">std::locale
 </td><td class=
"memItemRight" valign=
"bottom"><a class=
"el" href=
"namespaceboost_1_1locale_1_1util.html#aedf56793c0804295e06cf97300b991f8">create_utf8_codecvt
</a> (std::locale const
&in,
<a class=
"el" href=
"namespaceboost_1_1locale.html#a8c993aaf15e683e97d062560ccf914d8">character_facet_type
</a> type)
</td></tr>
102 <tr class=
"separator:aedf56793c0804295e06cf97300b991f8"><td class=
"memSeparator" colspan=
"2"> </td></tr>
103 <tr class=
"memitem:a674c01466528780b9076a191e84e05fa"><td class=
"memItemLeft" align=
"right" valign=
"top">std::locale
 </td><td class=
"memItemRight" valign=
"bottom"><a class=
"el" href=
"namespaceboost_1_1locale_1_1util.html#a674c01466528780b9076a191e84e05fa">create_simple_codecvt
</a> (std::locale const
&in, std::string const
&encoding,
<a class=
"el" href=
"namespaceboost_1_1locale.html#a8c993aaf15e683e97d062560ccf914d8">character_facet_type
</a> type)
</td></tr>
104 <tr class=
"separator:a674c01466528780b9076a191e84e05fa"><td class=
"memSeparator" colspan=
"2"> </td></tr>
106 <a name=
"details" id=
"details"></a><h2 class=
"groupheader">Detailed Description
</h2>
107 <div class=
"textblock"><p>This namespace provides various utility function useful for Boost.Locale backends implementations.
</p>
108 </div><h2 class=
"groupheader">Function Documentation
</h2>
109 <a class=
"anchor" id=
"a3e6728910dc947c3062c6bfd28b70fc4"></a>
110 <div class=
"memitem">
111 <div class=
"memproto">
112 <table class=
"memname">
114 <td class=
"memname">std::locale boost::locale::util::create_codecvt
</td>
116 <td class=
"paramtype">std::locale const
& </td>
117 <td class=
"paramname"><em>in
</em>,
</td>
120 <td class=
"paramkey"></td>
122 <td class=
"paramtype">std::auto_ptr
< base_converter
> </td>
123 <td class=
"paramname"><em>cvt
</em>,
</td>
126 <td class=
"paramkey"></td>
128 <td class=
"paramtype">character_facet_type
 </td>
129 <td class=
"paramname"><em>type
</em> </td>
137 </div><div class=
"memdoc">
138 <p>Install codecvt facet into locale
<em>in
</em> and return new locale that is based on
<em>in
</em> and uses new facet.
</p>
139 <p>codecvt facet would convert between narrow and wide/char16_t/char32_t encodings using
<em>cvt
</em> converter. If
<em>cvt
</em> is null pointer, always failure conversion would be used that fails on every first input or output.
</p>
140 <p>Note: the codecvt facet handles both UTF-
16 and UTF-
32 wide encodings, it knows to break and join Unicode code-points above
0xFFFF to and from surrogate pairs correctly.
<em>cvt
</em> should be unaware of wide encoding type
</p>
144 <a class=
"anchor" id=
"a8322299021a4af3cdbb8b31e775e77f4"></a>
145 <div class=
"memitem">
146 <div class=
"memproto">
147 <table class=
"memname">
149 <td class=
"memname">std::locale boost::locale::util::create_info
</td>
151 <td class=
"paramtype">std::locale const
& </td>
152 <td class=
"paramname"><em>in
</em>,
</td>
155 <td class=
"paramkey"></td>
157 <td class=
"paramtype">std::string const
& </td>
158 <td class=
"paramname"><em>name
</em> </td>
166 </div><div class=
"memdoc">
168 <p>Installs information facet to locale in based on locale name
<em>name
</em>.
</p>
169 <p>This function installs
<a class=
"el" href=
"classboost_1_1locale_1_1info.html" title=
"a facet that holds general information about locale ">boost::locale::info
</a> facet into the locale
<em>in
</em> and returns newly created locale.
</p>
170 <p>Note: all information is based only on parsing of string
<em>name
</em>;
</p>
171 <p>The name has following format: language[_COUNTRY][.encoding][@variant] Where language is ISO-
639 language code like
"en" or
"ru", COUNTRY is ISO-
3166 country identifier like
"US" or
"RU". the Encoding is a charracter set name like UTF-
8 or ISO-
8859-
1. Variant is backend specific variant like
<code>euro
</code> or calendar=hebrew.
</p>
172 <p>If some parameters are missing they are specified as blanks, default encoding is assumed to be US-ASCII and missing language is assumed to be
"C" </p>
176 <a class=
"anchor" id=
"a674c01466528780b9076a191e84e05fa"></a>
177 <div class=
"memitem">
178 <div class=
"memproto">
179 <table class=
"memname">
181 <td class=
"memname">std::locale boost::locale::util::create_simple_codecvt
</td>
183 <td class=
"paramtype">std::locale const
& </td>
184 <td class=
"paramname"><em>in
</em>,
</td>
187 <td class=
"paramkey"></td>
189 <td class=
"paramtype">std::string const
& </td>
190 <td class=
"paramname"><em>encoding
</em>,
</td>
193 <td class=
"paramkey"></td>
195 <td class=
"paramtype">character_facet_type
 </td>
196 <td class=
"paramname"><em>type
</em> </td>
204 </div><div class=
"memdoc">
205 <p>This function installs codecvt that can be used for conversion between single byte character encodings like ISO-
8859-
1, koi8-r, windows-
1255 and Unicode code points,
</p>
206 <p>Throws
<a class=
"el" href=
"classboost_1_1locale_1_1conv_1_1invalid__charset__error.html" title=
"This exception is thrown in case of use of unsupported or invalid character set. ">boost::locale::conv::invalid_charset_error
</a> if the chacater set is not supported or isn't single byte character set
</p>
210 <a class=
"anchor" id=
"a79624ad8d782ad41d5edf90b6c830631"></a>
211 <div class=
"memitem">
212 <div class=
"memproto">
213 <table class=
"memname">
215 <td class=
"memname">std::auto_ptr
<<a class=
"el" href=
"classboost_1_1locale_1_1util_1_1base__converter.html">base_converter
</a>> boost::locale::util::create_simple_converter
</td>
217 <td class=
"paramtype">std::string const
& </td>
218 <td class=
"paramname"><em>encoding
</em></td><td>)
</td>
222 </div><div class=
"memdoc">
223 <p>This function creates a
<em><a class=
"el" href=
"classboost_1_1locale_1_1util_1_1base__converter.html" title=
"This class represent a simple stateless converter from UCS-4 and to UCS-4 for each single code point...">base_converter
</a></em> that can be used for conversion between single byte character encodings like ISO-
8859-
1, koi8-r, windows-
1255 and Unicode code points,
</p>
224 <p>If
<em>encoding
</em> is not supported, empty pointer is returned. You should check if std::auto_ptr
<base_converter
>::get() !=
0 </p>
228 <a class=
"anchor" id=
"aedf56793c0804295e06cf97300b991f8"></a>
229 <div class=
"memitem">
230 <div class=
"memproto">
231 <table class=
"memname">
233 <td class=
"memname">std::locale boost::locale::util::create_utf8_codecvt
</td>
235 <td class=
"paramtype">std::locale const
& </td>
236 <td class=
"paramname"><em>in
</em>,
</td>
239 <td class=
"paramkey"></td>
241 <td class=
"paramtype">character_facet_type
 </td>
242 <td class=
"paramname"><em>type
</em> </td>
250 </div><div class=
"memdoc">
251 <p>Install utf8 codecvt to UTF-
16 or UTF-
32 into locale
<em>in
</em> and return new locale that is based on
<em>in
</em> and uses new facet.
</p>
255 <a class=
"anchor" id=
"aa8e8480ddadc3e972aeb4d468446db64"></a>
256 <div class=
"memitem">
257 <div class=
"memproto">
258 <table class=
"memname">
260 <td class=
"memname">std::auto_ptr
<<a class=
"el" href=
"classboost_1_1locale_1_1util_1_1base__converter.html">base_converter
</a>> boost::locale::util::create_utf8_converter
</td>
262 <td class=
"paramname"></td><td>)
</td>
266 </div><div class=
"memdoc">
267 <p>This function creates a
<em><a class=
"el" href=
"classboost_1_1locale_1_1util_1_1base__converter.html" title=
"This class represent a simple stateless converter from UCS-4 and to UCS-4 for each single code point...">base_converter
</a></em> that can be used for conversion between UTF-
8 and unicode code points
</p>
271 <a class=
"anchor" id=
"ad9737569d0e2d6b08885b01aba308365"></a>
272 <div class=
"memitem">
273 <div class=
"memproto">
274 <table class=
"memname">
276 <td class=
"memname">std::string boost::locale::util::get_system_locale
</td>
278 <td class=
"paramtype">bool
 </td>
279 <td class=
"paramname"><em>use_utf8_on_windows
</em> =
<code>false
</code></td><td>)
</td>
283 </div><div class=
"memdoc">
285 <p>Return default system locale name in POSIX format.
</p>
286 <p>This function tries to detect the locale using, LC_CTYPE, LC_ALL and LANG environment variables in this order and if all of them unset, in POSIX platforms it returns
"C"</p>
287 <p>On Windows additionally to check the above environment variables, this function tries to creates locale name from ISO-
339 and ISO-
3199 country codes defined for user default locale. If
<em>use_utf8_on_windows
</em> is true it sets the encoding to UTF-
8, otherwise, if system locale supports ANSI code-page it defines the ANSI encoding like windows-
1252, otherwise it fall-backs to UTF-
8 encoding if ANSI code-page is not available.
</p>
291 </div><!-- contents -->
292 </div><!-- doc-content -->
295 © Copyright
2009-
2012 Artyom Beilis, Distributed under the
<a href=
"http://www.boost.org/LICENSE_1_0.txt">Boost Software License
</a>, Version
1.0.