📄 xbd_chap07.html
字号:
first day. Rather than change the order and introduce potential confusion, the days must be specified beginning with Sunday;previous references to "first day" have been removed. Note also that the Shell and Utilities volume ofIEEE Std 1003.1-2001 <a href="../utilities/date.html"><i>date</i></a> utility supports numbering compliant with theISO 8601:2000 standard.</p><p>As specified under <a href="../utilities/date.html"><i>date</i></a> in the Shell and Utilities volume ofIEEE Std 1003.1-2001 and <a href="../functions/strftime.html"><i>strftime</i>()</a> in the System Interfaces volume ofIEEE Std 1003.1-2001, the conversion specifications corresponding to the optional keywords consist of a modifier followedby a traditional conversion specification (for instance, <tt>%Ex</tt> ). If the optional keywords are not supported by theimplementation or are unspecified for the current locale, these modified conversion specifications are treated as the traditionalconversion specifications. For example, assume the following keywords:</p><blockquote><pre><tt>alt_digits "0th";"1st";"2nd";"3rd";"4th";"5th";\ "6th";"7th";"8th";"9th";"10th"<br>d_fmt "The %Od day of %B in %Y"</tt></pre></blockquote><p>On July 4th 1776, the <tt>%x</tt> conversion specifications would result in <tt>"The 4th day of July in 1776"</tt> , while onJuly 14th 1789 it would result in <tt>"The 14 day of July in 1789"</tt> . It can be noted that the above example is forillustrative purposes only; the <tt>%O</tt> modifier is primarily intended to provide for Kanji or Hindi digits in <a href="../utilities/date.html"><i>date</i></a> formats.</p><p>The following is an example for Japan that supports the current plus last three Emperors and reverts to Western style numberingfor years prior to the Meiji era. The example also allows for the custom of using a special name for the first year of an erainstead of using 1. (The examples substitute romaji where kanji should be used.)</p><blockquote><pre><tt>era_d_fmt "%EY%mgatsu%dnichi (%a)"<br>era "+:2:1990/01/01:+*:Heisei:%EC%Eynen";\ "+:1:1989/01/08:1989/12/31:Heisei:%ECgannen";\ "+:2:1927/01/01:1989/01/07:Shouwa:%EC%Eynen";\ "+:1:1926/12/25:1926/12/31:Shouwa:%ECgannen";\ "+:2:1913/01/01:1926/12/24:Taishou:%EC%Eynen";\ "+:1:1912/07/30:1912/12/31:Taishou:%ECgannen";\ "+:2:1869/01/01:1912/07/29:Meiji:%EC%Eynen";\ "+:1:1868/09/08:1868/12/31:Meiji:%ECgannen";\ "-:1868:1868/09/07:-*::%Ey"</tt></pre></blockquote><p>Assuming that the current date is September 21, 1991, a request to <a href="../utilities/date.html"><i>date</i></a> or <a href="../functions/strftime.html"><i>strftime</i>()</a> would yield the following results:</p><blockquote><pre><tt>%Ec - Heisei3nen9gatsu21nichi (Sat) 14:39:26%EC - Heisei%Ex - Heisei3nen9gatsu21nichi (Sat)%Ey - 3%EY - Heisei3nen</tt></pre></blockquote><p>Example era definitions for the Republic of China:</p><blockquote><pre><tt>era "+:2:1913/01/01:+*:ChungHwaMingGuo:%EC%EyNen";\ "+:1:1912/1/1:1912/12/31:ChungHwaMingGuo:%ECYuenNen";\ "+:1:1911/12/31:-*:MingChien:%EC%EyNen"</tt></pre></blockquote><p>Example definitions for the Christian Era:</p><blockquote><pre><tt>era "+:1:0001/01/01:+*:AD:%EC %Ey";\ "+:1:-0001/12/31:-*:BC:%Ey %EC"</tt></pre></blockquote><h5><a name="tag_01_07_03_06"></a>LC_MESSAGES</h5><p>The <b>yesstr</b> and <b>nostr</b> locale keywords and the YESSTR and NOSTR <i>langinfo</i> items were formerly used to matchuser affirmative and negative responses. In IEEE Std 1003.1-2001, the <b>yesexpr</b>, <b>noexpr</b>, YESEXPR, and NOEXPRextended regular expressions have replaced them. Applications should use the general locale-based messaging facilities to issueprompting messages which include sample desired responses.</p><h4><a name="tag_01_07_04"></a>Locale Definition Grammar</h4><p>There is no additional rationale provided for this section.</p><h5><a name="tag_01_07_04_01"></a>Locale Lexical Conventions</h5><p>There is no additional rationale provided for this section.</p><h5><a name="tag_01_07_04_02"></a>Locale Grammar</h5><p>There is no additional rationale provided for this section.</p><h4><a name="tag_01_07_05"></a>Locale Definition Example</h4><p>The following is an example of a locale definition file that could be used as input to the <a href="../utilities/localedef.html"><i>localedef</i></a> utility. It assumes that the utility is executed with the <b>-f</b> option,naming a charmap file with (at least) the following content:</p><blockquote><pre><tt>CHARMAP<space> \x20<dollar> \x24<A> \101<a> \141<A-acute> \346<a-acute> \365<A-grave> \300<a-grave> \366<b> \142<C> \103<c> \143<c-cedilla> \347<d> \x64<H> \110<h> \150<eszet> \xb7<s> \x73<z> \x7aEND CHARMAP</tt></pre></blockquote><p>It should not be taken as complete or to represent any actual locale, but only to illustrate the syntax.</p><pre><tt>#LC_CTYPElower <a>;<b>;<c>;<c-cedilla>;<d>;...;<z>upper A;B;C;Ç;...;Zspace \x20;\x09;\x0a;\x0b;\x0c;\x0dblank \040;\011toupper (<a>,<A>);(b,B);(c,C);(ç,Ç);(d,D);(z,Z)END LC_CTYPE#LC_COLLATE## The following example of collation is based on# Canadian standard Z243.4.1-1998, "Canadian Alphanumeric# Ordering Standard for Character Sets of CSA Z234.4 Standard".# (Other parts of this example locale definition file do not# purport to relate to Canada, or to any other real culture.)# The proposed standard defines a 4-weight collation, such that# in the first pass, characters are compared without regard to# case or accents; in the second pass, backwards-compare without# regard to case; in the third pass, forwards-compare without# regard to diacriticals. In the 3 first passes, non-alphabetic# characters are ignored; in the fourth pass, only special# characters are considered, such that "The string that has a# special character in the lowest position comes first. If two# strings have a special character in the same position, the# collation value of the special character determines ordering.## Only a subset of the character set is used here; mostly to# illustrate the set-up.#collating-symbol <NULL>collating-symbol <LOW_VALUE>collating-symbol <LOWER-CASE>collating-symbol <SUBSCRIPT-LOWER>collating-symbol <SUPERSCRIPT-LOWER>collating-symbol <UPPER-CASE>collating-symbol <NO-ACCENT>collating-symbol <PECULIAR>collating-symbol <LIGATURE>collating-symbol <ACUTE>collating-symbol <GRAVE># Further collating-symbols follow.## Properly, the standard does not include any multi-character# collating elements; the one below is added for completeness.#collating_element <ch> from "<c><h>"collating_element <CH> from "<C><H>"collating_element <Ch> from "<C><h>"#order_start forward;backward;forward;forward,position## Collating symbols are specified first in the sequence to allocate# basic collation values to them, lower than that of any character.<NULL><LOW_VALUE><LOWER-CASE><SUBSCRIPT-LOWER><SUPERSCRIPT-LOWER><UPPER-CASE><NO-ACCENT><PECULIAR><LIGATURE><ACUTE><GRAVE><RING-ABOVE><DIAERESIS><TILDE># Further collating symbols are given a basic collating value here.## Here follow special characters.<space> IGNORE;IGNORE;IGNORE;<space># Other special characters follow here.## Here follow the regular characters.<a> <a>;<NO-ACCENT>;<LOWER-CASE>;IGNORE<A> <a>;<NO-ACCENT>;<UPPER-CASE>;IGNORE<a-acute> <a>;<ACUTE>;<LOWER-CASE>;IGNORE<A-acute> <a>;<ACUTE>;<UPPER-CASE>;IGNORE<a-grave> <a>;<GRAVE>;<LOWER-CASE>;IGNORE<A-grave> <a>;<GRAVE>;<UPPER-CASE>;IGNORE<ae> "<a><e>";"<LIGATURE><LIGATURE>";\ "<LOWER-CASE><LOWER-CASE>";IGNORE<AE> "<a><e>";"<LIGATURE><LIGATURE>";\ "<UPPER-CASE><UPPER-CASE>";IGNORE<b> <b>;<NO-ACCENT>;<LOWER-CASE>;IGNORE<B> <b>;<NO-ACCENT>;<UPPER-CASE>;IGNORE<c> <c>;<NO-ACCENT>;<LOWER-CASE>;IGNORE<C> <c>;<NO-ACCENT>;<UPPER-CASE>;IGNORE<ch> <ch>;<NO-ACCENT>;<LOWER-CASE>;IGNORE<Ch> <ch>;<NO-ACCENT>;<PECULIAR>;IGNORE<CH> <ch>;<NO-ACCENT>;<UPPER-CASE>;IGNORE## As an example, the strings "Bach" and "bach" could be encoded (for# compare purposes) as:# "Bach" <b>;<a>;<ch>;<LOW_VALUE>;<NO_ACCENT>;<NO_ACCENT>;\# <NO_ACCENT>;<LOW_VALUE>;<UPPER-CASE>;<LOWER-CASE>;\# <LOWER-CASE>;<NULL># "bach" <b>;<a>;<ch>;<LOW_VALUE>;<NO_ACCENT>;<NO_ACCENT>;\# <NO_ACCENT>;<LOW_VALUE>;<LOWER-CASE>;<LOWER-CASE>;\# <LOWER-CASE>;<NULL>## The two strings are equal in pass 1 and 2, but differ in pass 3.## Further characters follow.#UNDEFINED IGNORE;IGNORE;IGNORE;IGNORE#order_end#END LC_COLLATE#LC_MONETARYint_curr_symbol "USD "currency_symbol "$"mon_decimal_point "."mon_grouping 3;0positive_sign ""negative_sign "-"p_cs_precedes 1n_sign_posn 0END LC_MONETARY#LC_NUMERICcopy "US_en.ASCII"END LC_NUMERIC#LC_TIMEabday "Sun";"Mon";"Tue";"Wed";"Thu";"Fri";"Sat"#day "Sunday";"Monday";"Tuesday";"Wednesday";\ "Thursday";"Friday";"Saturday"#abmon "Jan";"Feb";"Mar";"Apr";"May";"Jun";\ "Jul";"Aug";"Sep";"Oct";"Nov";"Dec"#mon "January";"February";"March";"April";\ "May";"June";"July";"August";"September";\ "October";"November";"December"#d_t_fmt "%a %b %d %T %Z %Y\n"END LC_TIME#LC_MESSAGESyesexpr "^([yY][[:alpha:]]*)|(OK)"#noexpr "^[nN][[:alpha:]]*"END LC_MESSAGES</tt></pre><hr size="2" noshade><center><font size="2"><!--footer start-->UNIX ® is a registered Trademark of The Open Group.<br>POSIX ® is a registered Trademark of The IEEE.<br>[ <a href="../mindex.html">Main Index</a> | <a href="../basedefs/contents.html">XBD</a> | <a href="../utilities/contents.html">XCU</a> | <a href="../functions/contents.html">XSH</a> | <a href="../xrat/contents.html">XRAT</a>]</font></center><!--footer end--><hr size="2" noshade></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -