SUNWloc
The name of the output file is the value you assign to the keyword codeset in filename. The superuser should install this file as /usr/lib/locale/locale/LC_COLLATE /coll.so. It must be readable and executable by user, group, and other. Application programs consult this file when the LC_COLLATE environment is set appropriately, after having called setlocale(3C) .
The colltbl command can support languages whose collating sequence can be completely described by the following cases:
- Ordering of single characters within the codeset. For example, in English B is sorted after A, but before C and D.
- Equivalence class definition. A collection of characters is defined to have the same primary sort value. For example, in Finnish the letters French V and W compare equal. Both come after U but before X.
- Ordering of double characters in the collation sequence. For example, in Spanish ch is collated after c, and l is collated after ll.
- Ordering of one character as if it consists of two characters. For example, in German the "es-zet" ss is sorted as if it were ss. This is a special instance of the case below.
- Substitution of one character string with another character string. For example, spelled-out numbers, month and day names, and so forth, can be transformed so that they sort correctly.
- Null character mapping, so that certain characters in the codeset are ignored during collation. For example, if "-" were ignored during collation, then the strings re-locate and relocate would compare equal.
- Secondary ordering between characters. In the case where two characters are sorted together in the collation sequence, (that is, they have the same "primary" ordering), there is sometimes a secondary ordering that is used if two strings are identical except for characters that have the same primary ordering. For example, in French, the letters e and have the same primary ordering but e comes before in the secondary ordering. Thus the word lever would be ordered before lver, but lver would be sorted before levitate. (Note that if e came before in the primary ordering, then lver would be sorted after levitate.)
order is a;b;c;d;...;x;y;z
- the symbol itself (for example, a for the lower-case letter a),
- in octal representation (for example, \141 or 0141 for the letter a), or
- in hexadecimal representation (for example, \x61 or 0x61 for the letter a).
order is a;b;c;ch;d;(e;);f;...;z;\ {1;...;9};A;...;Z
substitute "Jan" with "01" substitute "Feb" with "02" ... substitute "Dec" with "12"
substitute "-" with ""
The substitute statement is optional. The order is and codeset statements are required.
Any lines in the specification file with a # in the first column are treated as comments and are ignored. Empty lines are also ignored.
The sorting sequence is defined by the following rules:
- Upper and lower case letters must be sorted together, but upper case letters have precedence over lower case letters.
- All special characters and punctuation must be ignored.
- Digits must be sorted as their alphabetic counterparts (0 as zero, 1 as one).
- The CH, Ch, ch combinations must be collated between C and D.
- V and W, v and w must be collated together.
The input specification file to colltbl should contain:
codeset telephone order is (A;a);(B;b);(C;c);(CH;Ch;ch);(D;d);(E;e);(F;f);(G;g);\ (H;h);(I;i);(J;j);(K;k);(L;l);(M;m);(N;n);(O;o);(P;p);\ (Q;q);(R;r);(S;s);(T;t);(U;u);{V;W};{v;w};(X;x);(Y;y);(Z;z) substitute "0" with "zero" substitute "1" with "one" substitute "2" with "two" substitute "3" with "three" substitute "4" with "four" substitute "5" with "five" substitute "6" with "six" substitute "7" with "seven" substitute "8" with "eight" substitute "9" with "nine"
to generate position independent code
- -G
- to output dynamically linked library
- -o
- to specify output filename
- -O
- to optimize code
- -K pic
Do not change files under the C locale, as this could cause undefined or nonstandard behavior.