/[gentoo]/xml/htdocs/doc/en/utf-8.xml
Gentoo

Diff of /xml/htdocs/doc/en/utf-8.xml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.17 Revision 1.27
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.17 2005/06/02 18:37:07 swift Exp $ --> 2<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/utf-8.xml,v 1.27 2005/07/02 11:55:16 swift 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
9 <mail link="slarti@gentoo.org">Thomas Martin</mail> 9 <mail link="slarti@gentoo.org">Thomas Martin</mail>
10</author> 10</author>
11<author title="Contributor"> 11<author title="Contributor">
12 <mail link="devil@gentoo.org.ua">Alexander Simonov</mail> 12 <mail link="devil@gentoo.org.ua">Alexander Simonov</mail>
13</author> 13</author>
14<author title="Editor">
15 <mail link="fox2mike@gentoo.org">Shyam Mani</mail>
16</author>
14 17
15<abstract> 18<abstract>
16This guide shows you how to set up and use the UTF-8 Unicode character set with 19This guide shows you how to set up and use the UTF-8 Unicode character set with
17your Gentoo Linux system, after explaining the benefits of Unicode and more 20your Gentoo Linux system, after explaining the benefits of Unicode and more
18specifically UTF-8. 21specifically UTF-8.
19</abstract> 22</abstract>
20 23
24<!-- The content of this document is licensed under the CC-BY-SA license -->
25<!-- See http://creativecommons.org/licenses/by-sa/2.5 -->
21<license /> 26<license />
22 27
23<version>2.1</version> 28<version>2.7</version>
24<date>2005-06-02</date> 29<date>2005-07-02</date>
25 30
26<chapter> 31<chapter>
27<title>Character Encodings</title> 32<title>Character Encodings</title>
28<section> 33<section>
29<title>What is a Character Encoding?</title> 34<title>What is a Character Encoding?</title>
226<section> 231<section>
227<title>Setting the Locale</title> 232<title>Setting the Locale</title>
228<body> 233<body>
229 234
230<p> 235<p>
231There is one environment variables that needs to be set in order to use 236There is one environment variable that needs to be set in order to use
232our new UTF-8 locales: <c>LC_ALL</c> (this variable overrides the <c>LANG</c> 237our new UTF-8 locales: <c>LC_ALL</c> (this variable overrides the <c>LANG</c>
233setting as well). There are also many different ways to set it; some people 238setting as well). There are also many different ways to set it; some people
234prefer to only have a UTF-8 environment for a specific user, in which case 239prefer to only have a UTF-8 environment for a specific user, in which case
235they set them in their <path>~/.profile</path> or <path>~/.bashrc</path>. 240they set them in their <path>~/.profile</path> (if you use <c>/bin/sh</c>),
241<path>~/.bash_profile</path> or <path>~/.bashrc</path> (if you use
242<c>/bin/bash</c>).
243</p>
244
245<p>
236Others prefer to set the locale globally. One specific circumstance where 246Others prefer to set the locale globally. One specific circumstance where
237the author particularly recommends doing this is when 247the author particularly recommends doing this is when
238<path>/etc/init.d/xdm</path> is in use, because 248<path>/etc/init.d/xdm</path> is in use, because
239this init script starts the display manager and desktop before any of the 249this init script starts the display manager and desktop before any of the
240aforementioned shell startup files are sourced, and so before any of the 250aforementioned shell startup files are sourced, and so before any of the
377making the most of Unicode. 387making the most of Unicode.
378</p> 388</p>
379 389
380<p> 390<p>
381The <c>KEYMAP</c> variable, set in <path>/etc/conf.d/keymaps</path>, should 391The <c>KEYMAP</c> variable, set in <path>/etc/conf.d/keymaps</path>, should
382have a Unicode keymap specified. To do this, simply prepend the keymap already 392have a Unicode keymap specified.
383specified there with -u.
384</p> 393</p>
385 394
386<pre caption="Example /etc/conf.d/keymaps snippet"> 395<pre caption="Example /etc/conf.d/keymaps snippet">
387<comment>(Change "uk" to your local layout)</comment> 396<comment>(Change "uk" to your local layout)</comment>
388KEYMAP="-u uk" 397KEYMAP="uk"
389</pre> 398</pre>
390 399
391</body> 400</body>
392</section> 401</section>
393<section> 402<section>
400</note> 409</note>
401 410
402<p> 411<p>
403It is wise to add <c>unicode</c> to your global USE flags in 412It is wise to add <c>unicode</c> to your global USE flags in
404<path>/etc/make.conf</path>, and then to remerge <c>sys-libs/ncurses</c> and 413<path>/etc/make.conf</path>, and then to remerge <c>sys-libs/ncurses</c> and
405also <c>sys-libs/slang</c> if appropriate: 414<c>sys-libs/slang</c> if appropriate:
406</p> 415</p>
407 416
408<pre caption="Emerging ncurses and slang"> 417<pre caption="Emerging ncurses and slang">
409<comment>(We avoid putting these libraries in our world file with --oneshot)</comment> 418<comment>(We avoid putting these libraries in our world file with --oneshot)</comment>
410# <i>emerge --oneshot --verbose --ask sys-libs/ncurses sys-libs/slang</i> 419# <i>emerge --oneshot sys-libs/ncurses sys-libs/slang</i>
411</pre> 420</pre>
412 421
413<p> 422<p>
414We also need to rebuild packages that link to these, now the USE changes have 423We also need to rebuild packages that link to these, now the USE changes have
415been applied. The tool we use (<c>revdep-rebuild</c>) is part of the 424been applied. The tool we use (<c>revdep-rebuild</c>) is part of the
522<section> 531<section>
523<title>Vim, Emacs, Xemacs and Nano</title> 532<title>Vim, Emacs, Xemacs and Nano</title>
524<body> 533<body>
525 534
526<p> 535<p>
527Vim, Emacs and Xemacs provide full UTF-8 support, and also have builtin 536Vim provides full UTF-8 support, and also has builtin detection of UTF-8 files.
528detection of UTF-8 files. For further information in Vim, use <c>:help 537For further information in Vim, use <c>:help mbyte.txt</c>.
529mbyte.txt</c>. 538</p>
539
530</p> 540<p>
541Emacs 22.x and higher has full UTF-8 support as well. Xemacs 22.x does not
542support combining characters yet.
543</p>
544
545<p>
546Lower versions of Emacs and/or Xemacs might require you to install
547<c>app-emacs/mule-ucs</c> and/or <c>app-xemacs/mule-ucs</c>
548and add the following code to your <path>~/.emacs</path> to have support for CJK
549languages in UTF-8:
550</p>
551
552<pre caption="Emacs CJK UTF-8 support">
553(require 'un-define)
554(require 'jisx0213)
555(set-language-environment "Japanese")
556(set-default-coding-systems 'utf-8)
557(set-terminal-coding-system 'utf-8)
558</pre>
531 559
532<p> 560<p>
533Nano currently does not provide support for UTF-8, although it has been planned 561Nano currently does not provide support for UTF-8, although it has been planned
534for a long time. With luck, this will change in future. At the time of writing, 562for a long time. With luck, this will change in future. At the time of writing,
535UTF-8 support is in Nano's CVS, and should be included in the next release. 563UTF-8 support is in Nano's CVS, and should be included in the next release.
595about this than to ask them to configure their client correctly. 623about this than to ask them to configure their client correctly.
596</note> 624</note>
597 625
598<p> 626<p>
599Further information is available from the <uri 627Further information is available from the <uri
600link="http://wiki.mutt.org/index.cgi?MuttFaq/Charset"> Mutt WikiWiki</uri>. 628link="http://wiki.mutt.org/index.cgi?MuttFaq/Charset">Mutt Wiki</uri>.
601</p> 629</p>
602 630
603</body> 631</body>
604</section> 632</section>
605<section> 633<section>
636<pre caption="man.conf changes for Unicode support"> 664<pre caption="man.conf changes for Unicode support">
637<comment>(This is the old line)</comment> 665<comment>(This is the old line)</comment>
638NROFF /usr/bin/nroff -Tascii -c -mandoc 666NROFF /usr/bin/nroff -Tascii -c -mandoc
639<comment>(Replace the one above with this)</comment> 667<comment>(Replace the one above with this)</comment>
640NROFF /usr/bin/nroff -mandoc -c 668NROFF /usr/bin/nroff -mandoc -c
669</pre>
670
671</body>
672</section>
673<section>
674<title>elinks and links</title>
675<body>
676
677<p>
678These are commonly used text-based browsers, and we shall see how we can enable
679UTF-8 support on them. On <c>elinks</c> and <c>links</c>, there are two ways to
680go about this, one using the Setup option from within the browser or editing the
681config file. To set the option through the browser, open a site with
682<c>elinks</c> or <c>links</c> and then <c>Alt+S</c> to enter the Setup Menu then
683select Terminal options, or press <c>T</c>. Scroll down and select the last
684option <c>UTF-8 I/O</c> by pressing Enter. Then Save and exit the menu. On
685<c>links</c> you may have to do a repeat <c>Alt+S</c> and then press <c>S</c> to
686save. The config file option, is shown below.
687</p>
688
689<pre caption="Enabling UTF-8 for elinks/links">
690<comment>(For elinks, edit /etc/elinks/elinks.conf or ~/.elinks/elinks.conf and
691add the following line)</comment>
692set terminal.linux.utf_8_io = 1
693
694<comment>(For links, edit ~/.links/links.cfg and add the following
695line)</comment>
696terminal "xterm" 0 1 0 us-ascii utf-8
641</pre> 697</pre>
642 698
643</body> 699</body>
644</section> 700</section>
645<section> 701<section>

Legend:
Removed from v.1.17  
changed lines
  Added in v.1.27

  ViewVC Help
Powered by ViewVC 1.1.20