亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? library_7.html

?? linux_c函數,linux下編程必備的
?? HTML
?? 第 1 頁 / 共 2 頁
字號:
<!-- This HTML file has been created by texi2html 1.27
     from library.texinfo on 3 March 1994 -->

<TITLE>The GNU C Library - Locales and Internationalization</TITLE>
<P>Go to the <A HREF="library_6.html" tppabs="http://www.cs.utah.edu/dept/old/texinfo/glibc-manual-0.02/library_6.html">previous</A>, <A HREF="library_8.html" tppabs="http://www.cs.utah.edu/dept/old/texinfo/glibc-manual-0.02/library_8.html">next</A> section.<P>
<H1><A NAME="SEC76" HREF="library_toc.html#SEC76" tppabs="http://www.cs.utah.edu/dept/old/texinfo/glibc-manual-0.02/library_toc.html#SEC76">Locales and Internationalization</A></H1>
<P>
Different countries and cultures have varying conventions for how to
communicate.  These conventions range from very simple ones, such as the
format for representing dates and times, to very complex ones, such as
the language spoken.
<A NAME="IDX356"></A>
<A NAME="IDX357"></A>
<P>
<DFN>Internationalization</DFN> of software means programming it to be able
to adapt to the user's favorite conventions.  In ANSI C,
internationalization works by means of <DFN>locales</DFN>.  Each locale
specifies a collection of conventions, one convention for each purpose.
The user chooses a set of conventions by specifying a locale (via
environment variables).
<P>
All programs inherit the chosen locale as part of their environment.
Provided the programs are written to obey the choice of locale, they
will follow the conventions preferred by the user.
<P>
<H2><A NAME="SEC77" HREF="library_toc.html#SEC77" tppabs="http://www.cs.utah.edu/dept/old/texinfo/glibc-manual-0.02/library_toc.html#SEC77">What Effects a Locale Has</A></H2>
<P>
Each locale specifies conventions for several purposes, including the
following:
<P>
<UL>
<LI>
What multibyte character sequences are valid, and how they are
interpreted (see section <A HREF="library_6.html#SEC66" tppabs="http://www.cs.utah.edu/dept/old/texinfo/glibc-manual-0.02/library_6.html#SEC66">Extended Characters</A>).
<P>
<LI>
Classification of which characters in the local character set are
considered alphabetic, and upper- and lower-case conversion conventions
(see section <A HREF="library_4.html#SEC54" tppabs="http://www.cs.utah.edu/dept/old/texinfo/glibc-manual-0.02/library_4.html#SEC54">Character Handling</A>).
<P>
<LI>
The collating sequence for the local language and character set
(see section <A HREF="library_5.html#SEC63" tppabs="http://www.cs.utah.edu/dept/old/texinfo/glibc-manual-0.02/library_5.html#SEC63">Collation Functions</A>).
<P>
<LI>
Formatting of numbers and currency amounts.
<P>
<LI>
Formatting of dates and times (see section <A HREF="library_19.html#SEC317" tppabs="http://www.cs.utah.edu/dept/old/texinfo/glibc-manual-0.02/library_19.html#SEC317">Formatting Date and Time</A>).
<P>
<LI>
What language to use for output, including error messages.
(The C library doesn't yet help you implement this.)
<P>
<LI>
What language to use for user answers to yes-or-no questions.
<P>
<LI>
What language to use for more complex user input.
(The C library doesn't yet help you implement this.)
</UL>
<P>
Some aspects of adapting to the specified locale are handled
automatically by the library subroutines.  For example, all your program
needs to do in order to use the collating sequence of the chosen locale
is to use <CODE>strcoll</CODE> or <CODE>strxfrm</CODE> to compare strings.
<P>
Other aspects of locales are beyond the comprehension of the library.
For example, the library can't automatically translate your program's
output messages into other languages.  The only way you can support
output in the user's favorite language is to program this more or less
by hand.  (Eventually, we hope to provide facilities to make this
easier.)
<P>
This chapter discusses the mechanism by which you can modify the current
locale.  The effects of the current locale on specific library functions
are discussed in more detail in the descriptions of those functions.
<P>
<H2><A NAME="SEC78" HREF="library_toc.html#SEC78" tppabs="http://www.cs.utah.edu/dept/old/texinfo/glibc-manual-0.02/library_toc.html#SEC78">Choosing a Locale</A></H2>
<P>
The simplest way for the user to choose a locale is to set the
environment variable <CODE>LANG</CODE>.  This specifies a single locale to use
for all purposes.  For example, a user could specify a hypothetical
locale named <SAMP>`espana-castellano'</SAMP> to use the standard conventions of
most of Spain.
<P>
The set of locales supported depends on the operating system you are
using, and so do their names.  We can't make any promises about what
locales will exist, except for one standard locale called <SAMP>`C'</SAMP> or
<SAMP>`POSIX'</SAMP>.
<A NAME="IDX358"></A>
<P>
A user also has the option of specifying different locales for different
purposes--in effect, choosing a mixture of two locales.
<P>
For example, the user might specify the locale <SAMP>`espana-castellano'</SAMP>
for most purposes, but specify the locale <SAMP>`usa-english'</SAMP> for
currency formatting.  This might make sense if the user is a
Spanish-speaking American, working in Spanish, but representing monetary
amounts in US dollars.
<P>
Note that both locales <SAMP>`espana-castellano'</SAMP> and <SAMP>`usa-english'</SAMP>,
like all locales, would include conventions for all of the purposes to
which locales apply.  However, the user can choose to use each locale
for a particular subset of those purposes.
<P>
<A NAME="IDX359"></A>
<A NAME="IDX360"></A>
<H2><A NAME="SEC79" HREF="library_toc.html#SEC79" tppabs="http://www.cs.utah.edu/dept/old/texinfo/glibc-manual-0.02/library_toc.html#SEC79">Categories of Activities that Locales Affect</A></H2>
<P>
The purposes that locales serve are grouped into <DFN>categories</DFN>, so
that a user or a program can choose the locale for each category
independently.  Here is a table of categories; each name is both an
environment variable that a user can set, and a macro name that you can
use as an argument to <CODE>setlocale</CODE>.
<P>
<DL COMPACT>
<A NAME="IDX361"></A>
<DT><CODE>LC_COLLATE</CODE>
<DD>This category applies to collation of strings (functions <CODE>strcoll</CODE>
and <CODE>strxfrm</CODE>); see section <A HREF="library_5.html#SEC63" tppabs="http://www.cs.utah.edu/dept/old/texinfo/glibc-manual-0.02/library_5.html#SEC63">Collation Functions</A>.
<P>
<A NAME="IDX362"></A>
<DT><CODE>LC_CTYPE</CODE>
<DD>This category applies to classification and conversion of characters;
see section <A HREF="library_4.html#SEC54" tppabs="http://www.cs.utah.edu/dept/old/texinfo/glibc-manual-0.02/library_4.html#SEC54">Character Handling</A>.
<P>
<A NAME="IDX363"></A>
<DT><CODE>LC_MONETARY</CODE>
<DD>This category applies to formatting monetary values; see section <A HREF="library_7.html#SEC82" tppabs="http://www.cs.utah.edu/dept/old/texinfo/glibc-manual-0.02/library_7.html#SEC82">Numeric Formatting</A>.
<P>
<A NAME="IDX364"></A>
<DT><CODE>LC_NUMERIC</CODE>
<DD>This category applies to formatting numeric values that are not
monetary; see section <A HREF="library_7.html#SEC82" tppabs="http://www.cs.utah.edu/dept/old/texinfo/glibc-manual-0.02/library_7.html#SEC82">Numeric Formatting</A>.
<P>
<A NAME="IDX365"></A>
<DT><CODE>LC_TIME</CODE>
<DD>This category applies to formatting date and time values; see
section <A HREF="library_19.html#SEC317" tppabs="http://www.cs.utah.edu/dept/old/texinfo/glibc-manual-0.02/library_19.html#SEC317">Formatting Date and Time</A>.
<P>
<A NAME="IDX366"></A>
<DT><CODE>LC_ALL</CODE>
<DD>This is not an environment variable; it is only a macro that you can use
with <CODE>setlocale</CODE> to set a single locale for all purposes.
<P>
<A NAME="IDX367"></A>
<DT><CODE>LANG</CODE>
<DD>If this environment variable is defined, its value specifies the locale
to use for all purposes except as overridden by the variables above.
</DL>
<P>
<H2><A NAME="SEC80" HREF="library_toc.html#SEC80" tppabs="http://www.cs.utah.edu/dept/old/texinfo/glibc-manual-0.02/library_toc.html#SEC80">How Programs Set the Locale</A></H2>
<P>
A C program inherits its locale environment variables when it starts up.
This happens automatically.  However, these variables do not
automatically control the locale used by the library functions, because
ANSI C says that all programs start by default in the standard <SAMP>`C'</SAMP>
locale.  To use the locales specified by the environment, you must call
<CODE>setlocale</CODE>.  Call it as follows:
<P>
<PRE>
setlocale (LC_ALL, "");
</PRE>
<P>
to select a locale based on the appropriate environment variables.
<A NAME="IDX368"></A>
<A NAME="IDX369"></A>
<P>
You can also use <CODE>setlocale</CODE> to specify a particular locale, for
general use or for a specific category.
<A NAME="IDX370"></A>
<P>
The symbols in this section are defined in the header file <TT>`locale.h'</TT>.
<P>
<A NAME="IDX371"></A>
<U>Function:</U> char * <B>setlocale</B> <I>(int <VAR>category</VAR>, const char *<VAR>locale</VAR>)</I><P>
The function <CODE>setlocale</CODE> sets the current locale for 
category <VAR>category</VAR> to <VAR>locale</VAR>.
<P>
If <VAR>category</VAR> is <CODE>LC_ALL</CODE>, this specifies the locale for all
purposes.  The other possible values of <VAR>category</VAR> specify an
individual purpose (see section <A HREF="library_7.html#SEC79" tppabs="http://www.cs.utah.edu/dept/old/texinfo/glibc-manual-0.02/library_7.html#SEC79">Categories of Activities that Locales Affect</A>).
<P>
You can also use this function to find out the current locale by passing
a null pointer as the <VAR>locale</VAR> argument.  In this case,
<CODE>setlocale</CODE> returns a string that is the name of the locale
currently selected for category <VAR>category</VAR>.
<P>
The string returned by <CODE>setlocale</CODE> can be overwritten by subsequent
calls, so you should make a copy of the string (see section <A HREF="library_5.html#SEC61" tppabs="http://www.cs.utah.edu/dept/old/texinfo/glibc-manual-0.02/library_5.html#SEC61">Copying and Concatenation</A>) if you want to save it past any further calls to
<CODE>setlocale</CODE>.  (The standard library is guaranteed never to call
<CODE>setlocale</CODE> itself.)
<P>
You should not modify the string returned by <CODE>setlocale</CODE>.
It might be the same string that was passed as an argument in a 
previous call to <CODE>setlocale</CODE>.
<P>
When you read the current locale for category <CODE>LC_ALL</CODE>, the value
encodes the entire combination of selected locales for all categories.
In this case, the value is not just a single locale name.  In fact, we
don't make any promises about what it looks like.  But if you specify
the same "locale name" with <CODE>LC_ALL</CODE> in a subsequent call to
<CODE>setlocale</CODE>, it restores the same combination of locale selections.
<P>
When the <VAR>locale</VAR> argument is not a null pointer, the string returned
by <CODE>setlocale</CODE> reflects the newly modified locale.
<P>
If you specify an empty string for <VAR>locale</VAR>, this means to read the
appropriate environment variable and use its value to select the locale
for <VAR>category</VAR>.
<P>
If you specify an invalid locale name, <CODE>setlocale</CODE> returns a null
pointer and leaves the current locale unchanged.
<P>
Here is an example showing how you might use <CODE>setlocale</CODE> to
temporarily switch to a new locale.
<P>
<PRE>
#include &#60;stddef.h&#62;
#include &#60;locale.h&#62;
#include &#60;stdlib.h&#62;
#include &#60;string.h&#62;

void
with_other_locale (char *new_locale,
                   void (*subroutine) (int),
                   int argument)
{
  char *old_locale, *saved_locale;

  /* Get the name of the current locale.  */
  old_locale = setlocale (LC_ALL, NULL);
  
  /* Copy the name so it won't be clobbered by <CODE>setlocale</CODE>. */
  saved_locale = strdup (old_locale);
  if (old_locale == NULL)
    fatal ("Out of memory");
  
  /* Now change the locale and do some stuff with it. */
  setlocale (LC_ALL, new_locale);
  (*subroutine) (argument);
  
  /* Restore the original locale. */
  setlocale (LC_ALL, saved_locale);
  free (saved_locale);
}
</PRE>
<P>
<STRONG>Portability Note:</STRONG> Some ANSI C systems may define additional
locale categories.  For portability, assume that any symbol beginning
with <SAMP>`LC_'</SAMP> might be defined in <TT>`locale.h'</TT>.
<P>
<H2><A NAME="SEC81" HREF="library_toc.html#SEC81" tppabs="http://www.cs.utah.edu/dept/old/texinfo/glibc-manual-0.02/library_toc.html#SEC81">Standard Locales</A></H2>
<P>
The only locale names you can count on finding on all operating systems
are these three standard ones:
<P>
<DL COMPACT>
<DT><CODE>"C"</CODE>
<DD>This is the standard C locale.  The attributes and behavior it provides
are specified in the ANSI C standard.  When your program starts up, it
initially uses this locale by default.
<P>
<DT><CODE>"POSIX"</CODE>
<DD>This is the standard POSIX locale.  Currently, it is an alias for the
standard C locale.
<P>
<DT><CODE>""</CODE>
<DD>The empty name stands for a site-specific default locale.  It's supposed
to be a good default for the machine on which the program is running.

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美不卡一区二区| 91无套直看片红桃| 一区二区成人在线观看| 久久久噜噜噜久久中文字幕色伊伊 | 不卡av在线网| 国产很黄免费观看久久| 久久精品国产成人一区二区三区| 亚洲第一狼人社区| 午夜视频在线观看一区二区三区| 亚洲色图都市小说| 亚洲欧美视频在线观看| 一区二区三区四区不卡在线| 亚洲色图.com| 亚洲午夜在线视频| 天天免费综合色| 日本视频免费一区| 久久精品国产精品亚洲红杏| 美女一区二区在线观看| 国产一区三区三区| 粉嫩高潮美女一区二区三区| av在线播放成人| 色呦呦国产精品| 欧美丰满嫩嫩电影| 精品国产第一区二区三区观看体验| 久久一夜天堂av一区二区三区| 精品美女在线观看| 欧美极品少妇xxxxⅹ高跟鞋| 国产精品久久久久久久久免费丝袜| 亚洲欧美色图小说| 午夜视频在线观看一区二区三区| 久久国产福利国产秒拍| 国产又粗又猛又爽又黄91精品| 成人美女在线视频| 欧美系列日韩一区| 久久色.com| 亚洲男人的天堂在线观看| 午夜久久久久久久久| 国产呦精品一区二区三区网站| 99久久精品国产一区| 欧美精品日日鲁夜夜添| 国产亚洲欧美激情| 亚洲1区2区3区4区| 99久久99久久免费精品蜜臀| 欧美写真视频网站| 久久久久久久综合日本| 亚洲综合色网站| 激情久久久久久久久久久久久久久久| 成人美女在线观看| 日韩精品一区国产麻豆| 亚洲欧美aⅴ...| 国产一区二区三区四区五区美女 | 国产在线国偷精品产拍免费yy| 99精品在线观看视频| 日韩免费一区二区三区在线播放| 日韩理论片一区二区| 久久国产精品色| 欧美日韩在线亚洲一区蜜芽| 国产精品色一区二区三区| 日产欧产美韩系列久久99| 色综合久久精品| 国产日韩欧美电影| 久久精品国产精品青草| 欧美日韩免费高清一区色橹橹| 国产丝袜欧美中文另类| 蜜桃久久久久久久| 欧美色精品在线视频| 国产精品国产三级国产有无不卡| 经典三级视频一区| 91精品国产综合久久婷婷香蕉| 中文字幕亚洲精品在线观看| 国产美女在线观看一区| 欧美一区二区三区性视频| 亚洲乱码国产乱码精品精可以看 | 国产三级欧美三级| 免费观看久久久4p| 欧美日本在线看| 亚洲国产日日夜夜| 在线精品视频一区二区| 亚洲人123区| 91片黄在线观看| 亚洲欧美国产三级| 99re成人精品视频| 亚洲欧美一区二区不卡| 色综合久久88色综合天天6| 亚洲欧美怡红院| 97久久精品人人爽人人爽蜜臀 | 国产精品一区二区久久精品爱涩| 欧美一区二区三区四区在线观看| 午夜精品一区二区三区电影天堂 | 激情五月婷婷综合网| 欧美嫩在线观看| 日本伊人色综合网| 日韩欧美一级二级| 国产美女久久久久| 国产欧美精品国产国产专区| 国产mv日韩mv欧美| 中国av一区二区三区| 色悠久久久久综合欧美99| 亚洲无线码一区二区三区| 91精品国产综合久久久蜜臀粉嫩 | 日本网站在线观看一区二区三区 | 欧美一区二区三区人| 精品一区二区三区的国产在线播放| 精品国产三级电影在线观看| 国产又黄又大久久| 亚洲免费视频中文字幕| 欧美日韩一区二区不卡| 美女尤物国产一区| 国产精品欧美极品| 欧美女孩性生活视频| 国内精品第一页| 中文字幕制服丝袜成人av | 一区二区三区国产豹纹内裤在线| 欧美中文字幕一区| 捆绑变态av一区二区三区| 免费欧美在线视频| 国产午夜亚洲精品午夜鲁丝片| 99这里只有久久精品视频| 婷婷国产在线综合| 亚洲国产精品ⅴa在线观看| 欧美午夜免费电影| 国产一区二区不卡老阿姨| 亚洲欧美日韩国产综合| 日韩一区二区三区高清免费看看| 懂色av一区二区三区蜜臀| 天天av天天翘天天综合网| 久久久亚洲国产美女国产盗摄| 在线一区二区三区四区五区| 九九**精品视频免费播放| 亚洲激情中文1区| 精品对白一区国产伦| 色偷偷久久人人79超碰人人澡 | xnxx国产精品| 欧美视频日韩视频| av在线一区二区三区| 精品一区二区在线观看| 午夜精品免费在线观看| 国产精品色婷婷久久58| 精品国产免费人成在线观看| 欧美日韩成人一区二区| 91在线看国产| 国产成人在线观看| 国内精品第一页| 麻豆国产一区二区| 日韩av电影免费观看高清完整版在线观看| 国产午夜亚洲精品不卡| 欧美va在线播放| 国产精品女同互慰在线看| 精品久久久网站| 欧美一区二区在线观看| 91.麻豆视频| 欧美日韩高清一区二区三区| 在线国产亚洲欧美| 色94色欧美sute亚洲线路一久| 丁香六月久久综合狠狠色| 国产揄拍国内精品对白| 国产一区免费电影| 国产精品1区2区| 国产精品一区二区久久不卡| 国产乱人伦偷精品视频不卡| 精品在线视频一区| 激情成人综合网| 成人综合婷婷国产精品久久蜜臀| 黄色成人免费在线| 国产精品系列在线播放| 国产精品一区二区久久精品爱涩| 国产精品亚洲视频| 国产成人免费视| 成人激情校园春色| 99久久伊人网影院| 在线一区二区三区做爰视频网站| 色美美综合视频| 欧美日韩一区二区三区不卡| 日韩一区二区三区在线视频| 日韩精品自拍偷拍| 国产日韩欧美精品电影三级在线| 中文av一区二区| 一级特黄大欧美久久久| 亚洲成年人网站在线观看| 奇米888四色在线精品| 国产资源在线一区| 波多野结衣精品在线| 欧美色综合网站| 日韩精品在线看片z| 国产精品初高中害羞小美女文| 极品尤物av久久免费看| 国产精品12区| 91蜜桃在线免费视频| 欧美精选午夜久久久乱码6080| 欧美一区二区三区免费观看视频| 久久综合色婷婷| 亚洲免费在线观看| 美腿丝袜亚洲一区| 99re热这里只有精品免费视频| 69成人精品免费视频| 国产午夜久久久久| 亚洲成人激情av| 国产精品白丝av| 欧美色大人视频| 久久色视频免费观看|