old-www/HOWTO/Indic-Fonts-HOWTO/locale.html

266 lines
5.6 KiB
HTML

<HTML
><HEAD
><TITLE
>Locale Setup</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.63
"><LINK
REL="HOME"
TITLE="The Indic Fonts HOWTO"
HREF="index.html"><LINK
REL="PREVIOUS"
TITLE="Devanagri Input and Output setup"
HREF="iosetup.html"><LINK
REL="NEXT"
TITLE="Applications with Devanagri"
HREF="apps.html"></HEAD
><BODY
CLASS="sect1"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>The Indic Fonts HOWTO</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="iosetup.html"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="apps.html"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="sect1"
><H1
CLASS="sect1"
><A
NAME="locale"
>4. Locale Setup</A
></H1
><DIV
CLASS="sect2"
><H2
CLASS="sect2"
><A
NAME="AEN118"
>4.1. Files and the kernel</A
></H2
><P
>&#13; You can now use any Unicode characters in file names. No kernel or file utilities need modifications. This is because file names in the kernel can be anything not containing a null byte, and '/' is used to delimit subdirectories. When encoded using UTF-8, non-ASCII characters will never be encoded using null bytes or slashes. All that happens is that file and directory names occupy more bytes than they contain characters. For example, a filename consisting of five greek characters will appear to the kernel as a 10-byte filename. The kernel does not know (and does not need to know) that these bytes are displayed as greek.
</P
><P
>&#13; This is the general theory, so long as your files reside on Linux. On filesystems which are used from other operating systems, you have mount options to control conversion of filenames to or from UTF-8:
<P
></P
><UL
><LI
><P
>&#13; The "vfat" filesystems has a mount option "utf8". See file <TT
CLASS="filename"
>/usr/src/linux/Documentation/filesystems/vfat.txt</TT
>. When you give an "iocharset" mount option different from the default (which is "iso8859-1"), the results with and without "utf8" are not consistent. Therefore, it is not I recommend to use the "iocharset" mount option.
</P
></LI
><LI
><P
>&#13; The "msdos", "umsdos" filesystems have the same mount option, but appear to have no effect.
</P
></LI
><LI
><P
>&#13; The "iso9660" filesystem has a mount option "utf8". See file <TT
CLASS="filename"
>/usr/src/linux/Documentation/filesystems/isofs.txt</TT
>.
</P
></LI
><LI
><P
>&#13; Since Linux 2.2.x kernels, the "ntfs" filesystem has a mount option "utf8". See file /usr/src/linux/Documentation/filesystems/ntfs.txt.
</P
></LI
></UL
>
</P
><P
>&#13; The other filesystems (nfs, smbfs, ncpfs, hpfs, etc.) don't convert filenames; therefore they support Unicode file names in UTF-8 encoding only if the other operating system supports them. Please note that to enable a mount option for all future remounts, you add it to the fourth column of the corresponding <TT
CLASS="filename"
>/etc/fstab</TT
> line.
</P
></DIV
><DIV
CLASS="sect2"
><H2
CLASS="sect2"
><A
NAME="AEN135"
>4.2. Locale environment variables</A
></H2
><P
>&#13; You should have the following environment variables set, containing locale names:
<P
></P
><DIV
CLASS="variablelist"
><DL
><DT
>LANGUAGE</DT
><DD
><P
>override for LC_MESSAGES</P
></DD
><DT
>LC_ALL</DT
><DD
><P
>override for all other LC_* variables</P
></DD
><DT
>LC_CTYPE, LC_MESSAGES, LC_COLLATE, LC_NUMERIC, LC_MONETARY, LC_TIME</DT
><DD
><P
>individual variables for: character types and encoding, natural language messages, sorting rules, number formatting, money amount formatting, date and time display.</P
></DD
><DT
>LANG</DT
><DD
><P
>default value for all LC_* variables. (See `man 7 locale' for a detailed description.)</P
></DD
></DL
></DIV
>
</P
><P
>&#13; In order to tell your system and all applications that you are using UTF-8, you need to add a codeset suffix of UTF-8 to your locale names. For example, if you want to run an application in UTF-8 Hindi locale then with bash shell, you can specify which environment variable to be passed to the application.
<TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="programlisting"
> $ LANG=hi_IN.UTF-8 xman</PRE
></FONT
></TD
></TR
></TABLE
>
In order to set locale the Hindi locale globally for a particular user, you can append the following line in <TT
CLASS="filename"
>~/.bashrc</TT
> file.
<TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="programlisting"
> export LANG=hi_IN.UTF-8</PRE
></FONT
></TD
></TR
></TABLE
>
After that you need not to set the LANG environment variable each time you run a specific application.
</P
></DIV
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="iosetup.html"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="apps.html"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>Devanagri Input and Output setup</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
>&nbsp;</TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>Applications with Devanagri</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>