⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 locale.html

📁 unix 下的C开发手册,还用详细的例程。
💻 HTML
📖 第 1 页 / 共 5 页
字号:
category defines character classification, case conversion and othercharacter attributes.In addition, a series of characters can be represented bythree adjacent periods representing an ellipsis symbol (...).The ellipsis specification is interpretedas meaning that all values between thevalues preceding and following it represent valid characters.The ellipsis specification is valid only withina single encoded character set;that is, within a group of characters of the same size.An ellipsis isinterpreted as including in the list all characters with an encodedvalue higher than the encoded value of the character preceding theellipsis and lower than the encoded value of the character followingthe ellipsis.<p><b>Example</b>:<code><pre>\x30;...;\x39;</code></pre>includes in the character class all characters with encoded valuesbetween the endpoints.<p>The following keywords are recognised.In the descriptions, the term &quot;automatically included&quot;means that it is not an error either toinclude or omit any of the referenced characters;the implementation will provide them if missing(even if the entire keyword is missing)and accept them silently if present.When the implementation automatically includesa missing character, it will have an encoded valuedependent on the charmapfile in effect (see the description of the<i><a href="../xcu/localedef.html">localedef</a></i><b>-f</b>option); otherwise, it will have a valuederived from an implementation-dependent character mapping.<p>The character classes<b>digit</b>,<b>xdigit</b>,<b>lower</b>,<b>upper</b>and<b>space</b>have a set of automatically included characters.These only need tobe specified if the character values (that is, encoding) differfrom the implementation default values.It is not possible to define a locale without theseautomatically included characters unless someimplementation extension is used to prevent their inclusion.Such a definition would not be a proper superset of theC or POSIX locale and thus, it might not be possible forapplications conforming to the XSI to work properly.<dl compact><dt><b>upper</b><dd>Define characters to be classified as upper-case letters.In the POSIX locale,the 26 upper-case lettersare included:<code><pre>A B C D E F G H I J K L M N O P Q R S T U V W X Y Z</code></pre>In a locale definition file,no character specified for the keywords<b>cntrl</b>,<b>digit</b>,<b>punct</b>or<b>space</b>can be specified.The upper-case lettersAtoZ,as defined in<xref href=charmap><a href="charset.html#tag_001_004">Character Set Description File</a></xref>(the portable character set),are automatically included in this class.<dt><b>lower</b><dd>Define characters to be classified as lower-case letters.In the POSIX locale,the 26 lower-case lettersare included:<code><pre>a b c d e f g h i j k l m n o p q r s t u v w x y z</code></pre>In a locale definition file,no character specified for the keywords<b>cntrl</b>,<b>digit</b>,<b>punct</b>or<b>space</b>can be specified.The lower-case lettersatozof the portable character setare automatically included in this class.<dt><b>alpha</b><dd>Define characters to be classified as letters.In the POSIX locale,all characters in the classes<b>upper</b>and<b>lower</b>are included.In a locale definition file,no character specified for the keywords<b>cntrl</b>,<b>digit</b>,<b>punct</b>or<b>space</b>can be specified.Characters classified as either<b>upper</b>or<b>lower</b>are automatically included in this class.<dt><b>digit</b><dd>Define the characters to be classified as numeric digits.In the POSIX locale, only:<code><pre>0 1 2 3 4 5 6 7 8 9</code></pre>are included.In a locale definition file,only the digits0,1,2,3,4,5,6,7,8and9can be specified,and incontiguous ascending sequence by numerical value.The digits0to9of the portable character setare automatically included in this class.The definition of character class<b>digit</b>requires that only tencharacters  the ones defining digits  can be specified;alternative digits (for example, Hindi or Kanji) cannot be specified here.However, the encoding may vary if an implementation supportsmore than one encoding.<dt><b>space</b><dd>Define characters to be classified as white-space characters.In the POSIX locale, at a minimum, the charactersspace, form-feed, newline, carriage-return, tab and vertical-tabare included.In a locale definition file,no character specified for the keywords<b>upper</b>,<b>lower</b>,<b>alpha</b>,<b>digit</b>,<b>graph</b>or<b>xdigit</b>can be specified.The characters space, form-feed, newline, carriage-return,tab and vertical-tab of the portable character set,and any characters included in the class<b>blank</b>are automatically included in this class.<dt><b>cntrl</b><dd>Define characters to be classified as control characters.In the POSIX locale,no characters in classes<b>alpha</b>or<b>print</b>are included.In a locale definition file,no character specified for the keywords<b>upper</b>,<b>lower</b>,<b>alpha</b>,<b>digit</b>,<b>punct</b>,<b>graph</b>,<b>print</b>or<b>xdigit</b>can be specified.<dt><b>punct</b><dd>Define characters to be classified as punctuation characters.In the POSIX locale, neither the spacecharacter nor any characters in classes<b>alpha</b>,<b>digit</b>or<b>cntrl</b>are included.In a locale definition file,no character specified for the keywords<b>upper</b>,<b>lower</b>,<b>alpha</b>,<b>digit</b>,<b>cntrl</b>,<b>xdigit</b>or as the space character can be specified.<dt><b>graph</b><dd>Define characters to be classified as printable characters, not including thespacecharacter.In the POSIX locale,all characters in classes<b>alpha</b>,<b>digit</b>and<b>punct</b>are included;no characters in class<b>cntrl</b>are included.In a locale definition file,characters specified for the keywords<b>upper</b>,<b>lower</b>,<b>alpha</b>,<b>digit</b>,<b>xdigit</b>and<b>punct</b>are automatically included in this class.No character specified for the keyword<b>cntrl</b>can be specified.<dt><b>print</b><dd>Define characters to be classified as printable characters, including thespacecharacter.In the POSIX locale,all characters in class<b>graph</b>are included;no characters in class<b>cntrl</b>are included.In a locale definition file,characters specified for the keywords<b>upper</b>,<b>lower</b>,<b>alpha</b>,<b>digit</b>,<b>xdigit</b>,<b>punct</b>and the space character are automatically included in this class.No character specified for the keyword<b>cntrl</b>can be specified.<dt><b>xdigit</b><dd>Define the characters to be classified as hexadecimal digits.In the POSIX locale, only:<code><pre>0 1 2 3 4 5 6 7 8 9 A B C D E F a b c d e f</code></pre>are included.In a locale definition file,only the characters defined for the class<b>digit</b>can be specified, incontiguous ascending sequence by numericalvalue, followed by one or more sets of six charactersrepresenting the hexadecimal digits 10 to 15 inclusive,with each set in ascending order (for exampleA,B,C,D,E,F,a,b,c,d,e,f).The digits0to9,the upper-case lettersAtoFand the lower-case lettersatofof the portable character setare automatically included in this class.The definition of character class<b>xdigit</b>requires that the characters included in character class<b>digit</b>be included here also.<dt><b>blank</b><dd>Define characters to be classified as blank characters.In the POSIX locale, only the space and tab characters are included.In a locale definition file, the characters space and tabare automatically included in this class.<dt><b>charclass</b><dd>Define one or more locale-specific character class namesas strings separated by semicolons.Each named character class can then be defined subsequentlyin the LC_CTYPE definition.A character class name consists of at least one and at most{CHARCLASS_NAME_MAX}bytes of alphanumeric characters from theportable filename character set.The first character of a character class namecannot be a digit.The name cannot match any of the LC_CTYPEkeywords defined in this specification.<dt><i>charclass-name</i><dd>Define characters to be classified as belongingto the named locale-specific character class.In the POSIX locale, the locale-specificnamed character classes need not exist.If a class name is defined by a<b>charclass</b>keyword, but no characters are subsequentlyassigned to it, this is not an error;it represents a class without any characters belonging to it.The<i>charclass-name</i>can be used as the<i>property</i>argument to the<i><a href="../xsh/wctype.html">wctype()</a></i>function, in regular expression and shell pattern-matchingbracket expressions, and by the<i><a href="../xcu/tr.html">tr</a></i>command.<dt><b>toupper</b><dd>Define the mapping of lower-case letters to upper-case letters.In the POSIX locale,at a minimum, the 26 lower-case characters:<code><pre>a b c d e f g h i j k l m n o p q r s t u v w x y z</code></pre>are mapped to the corresponding 26 upper-case characters:<code><pre>A B C D E F G H I J K L M N O P Q R S T U V W X Y Z</code></pre>In a locale definition file,the operand consists of character pairs, separated by semicolons.The characters in each character pair are separated by a comma andthe pair enclosed by parentheses.The first character in each pair is the lower-case letter, thesecond the corresponding upper-case letter.Only characters specified for the keywords<b>lower</b>and<b>upper</b>can be specified.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -