| 1 | <?xml version='1.0' encoding="UTF-8"?> |
1 | <?xml version='1.0' encoding="UTF-8"?> |
| 2 | <!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/utf-8.xml,v 1.44 2006/08/29 10:03:52 rane Exp $ --> |
2 | <!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/utf-8.xml,v 1.45 2006/10/06 18:35:52 nightmorph Exp $ --> |
| 3 | <!DOCTYPE guide SYSTEM "/dtd/guide.dtd"> |
3 | <!DOCTYPE guide SYSTEM "/dtd/guide.dtd"> |
| 4 | |
4 | |
| 5 | <guide link="/doc/en/utf-8.xml"> |
5 | <guide link="/doc/en/utf-8.xml"> |
| 6 | <title>Using UTF-8 with Gentoo</title> |
6 | <title>Using UTF-8 with Gentoo</title> |
| 7 | |
7 | |
| … | |
… | |
| 23 | |
23 | |
| 24 | <!-- The content of this document is licensed under the CC-BY-SA license --> |
24 | <!-- The content of this document is licensed under the CC-BY-SA license --> |
| 25 | <!-- See http://creativecommons.org/licenses/by-sa/2.5 --> |
25 | <!-- See http://creativecommons.org/licenses/by-sa/2.5 --> |
| 26 | <license /> |
26 | <license /> |
| 27 | |
27 | |
| 28 | <version>2.22</version> |
28 | <version>2.23</version> |
| 29 | <date>2006-08-28</date> |
29 | <date>2006-10-06</date> |
| 30 | |
30 | |
| 31 | <chapter> |
31 | <chapter> |
| 32 | <title>Character Encodings</title> |
32 | <title>Character Encodings</title> |
| 33 | <section> |
33 | <section> |
| 34 | <title>What is a Character Encoding?</title> |
34 | <title>What is a Character Encoding?</title> |
| … | |
… | |
| 229 | <section> |
229 | <section> |
| 230 | <title>Setting the Locale</title> |
230 | <title>Setting the Locale</title> |
| 231 | <body> |
231 | <body> |
| 232 | |
232 | |
| 233 | <p> |
233 | <p> |
| 234 | There is one environment variable that needs to be set in order to use |
234 | There is one environment variable that needs to be set in order to use our new |
| 235 | our new UTF-8 locales: <c>LC_ALL</c> (this variable overrides the <c>LANG</c> |
235 | UTF-8 locales: <c>LANG</c> (you can override this variable with the |
| 236 | setting as well). There are also many different ways to set it; some people |
236 | <c>LC_ALL</c> setting as well). There are also many different ways to set it; |
| 237 | prefer to only have a UTF-8 environment for a specific user, in which case |
237 | some people prefer to only have a UTF-8 environment for a specific user, in |
| 238 | they set them in their <path>~/.profile</path> (if you use <c>/bin/sh</c>), |
238 | which case they set them in their <path>~/.profile</path> (if you use |
| 239 | <path>~/.bash_profile</path> or <path>~/.bashrc</path> (if you use |
239 | <c>/bin/sh</c>), <path>~/.bash_profile</path> or <path>~/.bashrc</path> (if you |
| 240 | <c>/bin/bash</c>). |
240 | use <c>/bin/bash</c>). |
| 241 | </p> |
241 | </p> |
| 242 | |
242 | |
| 243 | <p> |
243 | <p> |
| 244 | Others prefer to set the locale globally. One specific circumstance where |
244 | Others prefer to set the locale globally. One specific circumstance where |
| 245 | the author particularly recommends doing this is when |
245 | the author particularly recommends doing this is when |
| … | |
… | |
| 255 | following: |
255 | following: |
| 256 | </p> |
256 | </p> |
| 257 | |
257 | |
| 258 | <pre caption="Demonstration /etc/env.d/02locale"> |
258 | <pre caption="Demonstration /etc/env.d/02locale"> |
| 259 | <comment>(As always, change "en_GB.UTF-8" to your locale)</comment> |
259 | <comment>(As always, change "en_GB.UTF-8" to your locale)</comment> |
| 260 | LC_ALL="en_GB.UTF-8" |
260 | LANG="en_GB.UTF-8" |
| 261 | </pre> |
261 | </pre> |
|
|
262 | |
|
|
263 | <note> |
|
|
264 | You can also substitute <c>LC_ALL</c> for <c>LANG</c>. This sets your locale |
|
|
265 | for all categories, including numerical and currency values. On a very few |
|
|
266 | systems, it might cause some issues. However, most users should be able to use |
|
|
267 | <c>LC_ALL</c> without problems. For more information on the categories affected |
|
|
268 | by using <c>LC_ALL</c>, please read the <uri |
|
|
269 | link="http://www.gnu.org/software/libc/manual/html_node/Locale-Categories.html#Locale-Categories">GNU |
|
|
270 | locale page</uri>. |
|
|
271 | </note> |
| 262 | |
272 | |
| 263 | <p> |
273 | <p> |
| 264 | Next, the environment must be updated with the change. |
274 | Next, the environment must be updated with the change. |
| 265 | </p> |
275 | </p> |
| 266 | |
276 | |