/[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.22 Revision 1.41
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.22 2005/06/23 00:36:22 smithj Exp $ --> 2<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/utf-8.xml,v 1.41 2006/07/15 17:22:49 fox2mike 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.3</version> 28<version>2.20</version>
29<date>2005-06-20</date> 29<date>2006-07-15</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>
339 your FAT filesystems or Joilet CD-ROMs.)</comment> 339 your FAT filesystems or Joilet CD-ROMs.)</comment>
340</pre> 340</pre>
341 341
342<p> 342<p>
343If you plan on mounting NTFS partitions, you may need to specify an <c>nls=</c> 343If you plan on mounting NTFS partitions, you may need to specify an <c>nls=</c>
344option with mount. For more information, see <c>man mount</c>. 344option with mount. If you plan on mounting FAT partitions, you may need to
345specify a <c>codepage=</c> option with mount. Optionally, you can also set a
346default codepage for FAT in the kernel configuration. Note that the
347<c>codepage</c> option with mount will override the kernel settings.
348</p>
349
350<pre caption="FAT settings in kernel configuration">
351File Systems --&gt;
352 DOS/FAT/NT Filesystems --&gt;
353 (437) Default codepage for fat
354</pre>
355
356<p>
357You should avoid setting <c>Default iocharset for fat</c> to UTF-8, as it is
358not recommended. Instead, you may want to pass the option utf8=true when
359mounting your FAT partitions. For further information, see <c>man mount</c> and
360the kernel documentation at
361<path>/usr/src/linux/Documentation/filesystems/vfat.txt</path>.
345</p> 362</p>
346 363
347<p> 364<p>
348For changing the encoding of filenames, <c>app-text/convmv</c> can be used. 365For changing the encoding of filenames, <c>app-text/convmv</c> can be used.
349</p> 366</p>
350 367
351<pre caption="Example usage of convmv"> 368<pre caption="Example usage of convmv">
352# <i>emerge --ask app-text/convmv</i> 369# <i>emerge --ask app-text/convmv</i>
370<comment>(Command format)</comment>
353# <i>convmv -f current-encoding -t utf-8 filename</i> 371# <i>convmv -f &lt;current-encoding&gt; -t utf-8 &lt;filename&gt;</i>
372<comment>(Substitute iso-8859-1 with the charset you are converting
373from)</comment>
374# <i>convmv -f iso-8859-1 -t utf-8 filename</i>
354</pre> 375</pre>
355 376
356<p> 377<p>
357For changing the <e>contents</e> of files, use the <c>iconv</c> utility, 378For changing the <e>contents</e> of files, use the <c>iconv</c> utility,
358bundled with <c>glibc</c>: 379bundled with <c>glibc</c>:
387making the most of Unicode. 408making the most of Unicode.
388</p> 409</p>
389 410
390<p> 411<p>
391The <c>KEYMAP</c> variable, set in <path>/etc/conf.d/keymaps</path>, should 412The <c>KEYMAP</c> variable, set in <path>/etc/conf.d/keymaps</path>, should
392have a Unicode keymap specified. To do this, simply prepend the keymap already 413have a Unicode keymap specified.
393specified there with -u.
394</p> 414</p>
395 415
396<pre caption="Example /etc/conf.d/keymaps snippet"> 416<pre caption="Example /etc/conf.d/keymaps snippet">
397<comment>(Change "uk" to your local layout)</comment> 417<comment>(Change "uk" to your local layout)</comment>
398KEYMAP="-u uk" 418KEYMAP="uk"
399</pre> 419</pre>
400 420
401</body> 421</body>
402</section> 422</section>
403<section> 423<section>
410</note> 430</note>
411 431
412<p> 432<p>
413It is wise to add <c>unicode</c> to your global USE flags in 433It is wise to add <c>unicode</c> to your global USE flags in
414<path>/etc/make.conf</path>, and then to remerge <c>sys-libs/ncurses</c> and 434<path>/etc/make.conf</path>, and then to remerge <c>sys-libs/ncurses</c> and
415<c>sys-libs/slang</c> if appropriate: 435<c>sys-libs/slang</c> if appropriate. Portage will do this automatically when
436you update your system:
416</p> 437</p>
417 438
418<pre caption="Emerging ncurses and slang"> 439<pre caption="Updating your system">
419<comment>(We avoid putting these libraries in our world file with --oneshot)</comment> 440# <i>emerge --update --deep --newuse world</i>
420# <i>emerge --oneshot sys-libs/ncurses sys-libs/slang</i>
421</pre> 441</pre>
422 442
423<p> 443<p>
424We also need to rebuild packages that link to these, now the USE changes have 444We also need to rebuild packages that link to these, now the USE changes have
425been applied. The tool we use (<c>revdep-rebuild</c>) is part of the 445been applied. The tool we use (<c>revdep-rebuild</c>) is part of the
514 534
515<p> 535<p>
516Terminal emulators that use Xft and support Unicode are harder to come by. 536Terminal emulators that use Xft and support Unicode are harder to come by.
517Aside from Konsole and gnome-terminal, the best options in Portage are 537Aside from Konsole and gnome-terminal, the best options in Portage are
518<c>x11-terms/rxvt-unicode</c>, <c>xfce-extra/terminal</c>, 538<c>x11-terms/rxvt-unicode</c>, <c>xfce-extra/terminal</c>,
519<c>gnustep-apps/terminal</c>, <c>x11-terms/mlterm</c>, <c>x11-terms/mrxvt</c> or 539<c>gnustep-apps/terminal</c>, <c>x11-terms/mlterm</c>, or plain
520plain <c>x11-terms/xterm</c> when built with the <c>unicode</c> USE flag and 540<c>x11-terms/xterm</c> when built with the <c>unicode</c> USE flag and invoked
521invoked as <c>uxterm</c>. <c>app-misc/screen</c> supports UTF-8 too, when 541as <c>uxterm</c>. <c>app-misc/screen</c> supports UTF-8 too, when invoked as
522invoked as <c>screen -u</c> or the following is put into the 542<c>screen -U</c> or the following is put into the <path>~/.screenrc</path>:
523<path>~/.screenrc</path>:
524</p> 543</p>
525 544
526<pre caption="~/.screenrc for UTF-8"> 545<pre caption="~/.screenrc for UTF-8">
527defutf8 on 546defutf8 on
528</pre> 547</pre>
532<section> 551<section>
533<title>Vim, Emacs, Xemacs and Nano</title> 552<title>Vim, Emacs, Xemacs and Nano</title>
534<body> 553<body>
535 554
536<p> 555<p>
537Vim, Emacs and Xemacs provide full UTF-8 support, and also have builtin 556Vim provides full UTF-8 support, and also has builtin detection of UTF-8 files.
538detection of UTF-8 files. For further information in Vim, use <c>:help 557For further information in Vim, use <c>:help mbyte.txt</c>.
539mbyte.txt</c>.
540</p>
541
542<p> 558</p>
543Nano currently does not provide support for UTF-8, although it has been planned 559
544for a long time. With luck, this will change in future. At the time of writing, 560<p>
545UTF-8 support is in Nano's CVS, and should be included in the next release. 561Emacs 22.x and higher has full UTF-8 support as well. Xemacs 22.x does not
562support combining characters yet.
563</p>
564
565<p>
566Lower versions of Emacs and/or Xemacs might require you to install
567<c>app-emacs/mule-ucs</c> and/or <c>app-xemacs/mule-ucs</c>
568and add the following code to your <path>~/.emacs</path> to have support for CJK
569languages in UTF-8:
570</p>
571
572<pre caption="Emacs CJK UTF-8 support">
573(require 'un-define)
574(require 'jisx0213)
575(set-language-environment "Japanese")
576(set-default-coding-systems 'utf-8)
577(set-terminal-coding-system 'utf-8)
578</pre>
579
580<p>
581Nano has provided full UTF-8 support since version 1.3.6.
546</p> 582</p>
547 583
548</body> 584</body>
549</section> 585</section>
550<section> 586<section>
567<section> 603<section>
568<title>Irssi</title> 604<title>Irssi</title>
569<body> 605<body>
570 606
571<p> 607<p>
572Since 0.8.10, Irssi has complete UTF-8 support, although it does require a user 608Irssi has complete UTF-8 support, although it does require a user
573to set an option. 609to set an option.
574</p> 610</p>
575 611
576<pre caption="Enabling UTF-8 in Irssi"> 612<pre caption="Enabling UTF-8 in Irssi">
577/set term_charset UTF-8 613/set term_charset UTF-8
589<title>Mutt</title> 625<title>Mutt</title>
590<body> 626<body>
591 627
592<p> 628<p>
593The Mutt mail user agent has very good Unicode support. To use UTF-8 with Mutt, 629The Mutt mail user agent has very good Unicode support. To use UTF-8 with Mutt,
594put the following in your <path>~/.muttrc</path>: 630you don't need to put anything in your configuration files. Mutt will work
595</p> 631under unicode enviroment without modification if all your configuration files
596 632(signature included) are UTF-8 encoded.
597<pre caption="~/.muttrc for UTF-8">
598set send_charset="utf8" <comment>(outgoing character set)</comment>
599set charset="utf8" <comment>(display character set)</comment>
600</pre> 633</p>
601 634
602<note> 635<note>
603You may still see '?' in mail you read with Mutt. This is a result of people 636You may still see '?' in mail you read with Mutt. This is a result of people
604using a mail client which does not indicate the used charset. You can't do much 637using a mail client which does not indicate the used charset. You can't do much
605about this than to ask them to configure their client correctly. 638about this than to ask them to configure their client correctly.
606</note> 639</note>
607 640
608<p> 641<p>
609Further information is available from the <uri 642Further information is available from the <uri
610link="http://wiki.mutt.org/index.cgi?MuttFaq/Charset"> Mutt WikiWiki</uri>. 643link="http://wiki.mutt.org/index.cgi?MuttFaq/Charset">Mutt Wiki</uri>.
611</p> 644</p>
612 645
613</body> 646</body>
614</section> 647</section>
615<section> 648<section>
674set terminal.linux.utf_8_io = 1 707set terminal.linux.utf_8_io = 1
675 708
676<comment>(For links, edit ~/.links/links.cfg and add the following 709<comment>(For links, edit ~/.links/links.cfg and add the following
677line)</comment> 710line)</comment>
678terminal "xterm" 0 1 0 us-ascii utf-8 711terminal "xterm" 0 1 0 us-ascii utf-8
712</pre>
713
714</body>
715</section>
716<section>
717<title>Samba</title>
718<body>
719
720<p>
721Samba is a software suite which implements the SMB (Server Message Block)
722protocol for UNIX systems such as Macs, Linux and FreeBSD. The protocol
723is also sometimes referred to as the Common Internet File System (CIFS). Samba
724also includes the NetBOIS system - used for file sharing over windows networks.
725</p>
726
727<pre caption="Enabling UTF-8 for Samba">
728<comment>(Edit /etc/samba/smb.conf and add the following under the [global] section)</comment>
729dos charset = 1255
730unix charset = UTF-8
731display charset = UTF-8
679</pre> 732</pre>
680 733
681</body> 734</body>
682</section> 735</section>
683<section> 736<section>
784 837
785<p> 838<p>
786AltGr can be used with alphabetical keys alone. For example, AltGr and m, a 839AltGr can be used with alphabetical keys alone. For example, AltGr and m, a
787Greek lower-case letter mu is produced: 'µ'. AltGr and s produce a 840Greek lower-case letter mu is produced: 'µ'. AltGr and s produce a
788scharfes s or esszet: 'ß'. As many European users would expect (because 841scharfes s or esszet: 'ß'. As many European users would expect (because
789it is marked on their keyboard), AltGr and 4 produces a Euro sign, '€'. 842it is marked on their keyboard), AltGr and 4 (or E depending on the keyboard
843layout) produces a Euro sign, '€'.
790</p> 844</p>
791 845
792</body> 846</body>
793</section> 847</section>
794<section> 848<section>
795<title>Resources</title> 849<title>Resources</title>
796<body> 850<body>
797 851
798<ul> 852<ul>
799 <li> 853 <li>
800 <uri link="http://www.wikipedia.com/wiki/Unicode">The Wikipedia entry for 854 <uri link="http://en.wikipedia.org/wiki/Unicode">The Wikipedia entry for
801 Unicode</uri> 855 Unicode</uri>
802 </li> 856 </li>
803 <li> 857 <li>
804 <uri link="http://www.wikipedia.com/wiki/UTF-8">The Wikipedia entry for 858 <uri link="http://en.wikipedia.org/wiki/UTF-8">The Wikipedia entry for
805 UTF-8</uri> 859 UTF-8</uri>
806 </li> 860 </li>
807 <li><uri link="http://www.unicode.org">Unicode.org</uri></li> 861 <li><uri link="http://www.unicode.org">Unicode.org</uri></li>
808 <li><uri link="http://www.utf-8.com">UTF-8.com</uri></li> 862 <li><uri link="http://www.utf-8.com">UTF-8.com</uri></li>
809 <li><uri link="http://www.ietf.org/rfc/rfc3629.txt">RFC 3629</uri></li> 863 <li><uri link="http://www.ietf.org/rfc/rfc3629.txt">RFC 3629</uri></li>

Legend:
Removed from v.1.22  
changed lines
  Added in v.1.41

  ViewVC Help
Powered by ViewVC 1.1.20