MKLOCALE(1)

πŸ“¦ version 237, in nixpkgs unstable

πŸ’… MKLOCALE(1) β€” the mklocale girlies' guide

okay so bestie, welcome to mklocale(1) β€” the General Commands Manual entry that makes your LC_CTYPE locale files. she's a little old-school, a little quirky, but she serves. let's get into it πŸŽ€


✨ NAME ✨

mklocale β€” make LC_CTYPE locale files. that's it. that's the job. iconic behaviour honestly πŸ’…


🌸 SYNOPSIS 🌸

mklocale [-d] < src-file > language/LC_CTYPE
mklocale [-d] -o language/LC_CTYPE src-file

two ways to run her, pick your fave 🫢


πŸ¦‹ DESCRIPTION πŸ¦‹

so the mklocale utility lowkey reads an LC_CTYPE source file from standard input and produces an LC_CTYPE binary file on standard output β€” and that output is exactly what you wanna drop into /usr/share/locale/language/LC_CTYPE. main character placement, no cap πŸ‘‘

the format of src-file is quite simple. fr fr. it's just a series of lines that start with a keyword and then have associated data following. and you can use C style comments to place comments in the file β€” say it with me, comments are self-care πŸ’–


πŸ”₯ OPTIONS πŸ”₯

Following options are available:

  • -d β€” turns on debugging messages. she's telling you everything, and honestly? we listen πŸ—£οΈ
  • -o β€” specify output file. you pick where she goes ✨

🧚 the valid tokens in src-file

besides the keywords which will be listed below, the following are valid tokens in src-file:

πŸ’œ RUNE

a RUNE may be any of the following:

  • 'x' β€” the ASCII character x.
  • '\x' β€” the ANSI C character \x where \x is one of \a, \b, \f, \n, \r, \t, or \v.
  • 0x[0-9a-z]* β€” a hexadecimal number representing a rune code.
  • 0[0-7]* β€” an octal number representing a rune code.
  • [1-9][0-9]* β€” a decimal number representing a rune code.

that's the whole rune menu, bestie. know it, love it πŸ“‹

🌈 STRING

a string enclosed in double quotes ("). that's the vibe.

⭐ THRU

either ... or -. used to indicate ranges. both are giving the same energy, pick whichever slays for you.

πŸ“ literal

the following characters are taken literally:

  • <([ β€” used to start a mapping. all are equivalent.
  • >)] β€” used to end a mapping. all are equivalent.
  • : β€” used as a delimiter in mappings.

πŸ‘‘ key words which should only appear once

okay these ones are one and done. do not come back for seconds.

  • ENCODING β€” followed by a STRING which indicates the encoding mechanism to be used for this locale. the current encodings are:
    • ASCII β€” American Standard Code for Information Interchange.
    • BIG5 β€” the β€œBig5” encoding of Chinese.
    • EUC β€” EUC encoding as used by several vendors of Unix systems.
    • GB18030 β€” PRC national standard for encoding of Chinese text.
    • GB2312 β€” older PRC national standard for encoding Chinese text.
    • GBK β€” a widely used encoding method for Chinese text, backwards compatible with GB 2312-1980.
    • MSKanji β€” the method of encoding Japanese used by Microsoft, loosely based on JIS. also known as β€œShift JIS” and β€œSJIS”.
    • NONE β€” no translation and the default. the chill option 🧊
    • UTF-8 β€” the UTF-8 transformation format of ISO 10646 as defined by RFC 2279.
  • VARIABLE β€” this keyword must be followed by a single tab or space character, after which encoding specific data is placed. currently only the EUC encoding requires variable data. see euc(5) for further details πŸ“–
  • INVALID β€” (obsolete) a single RUNE follows and is used as the invalid rune for this locale. she's ✨obsolete✨ β€” respect her history but maybe don't build your whole life around her πŸ’€

πŸŽ€ the mapping keywords (can appear multiple times)

the following keywords may appear multiple times and have the following format for data:

<RUNE1 RUNE2>              RUNE1 is mapped to RUNE2.

<RUNE1 THRU RUNEn: RUNE2>  Runes RUNE1 through RUNEn are mapped to
                           RUNE2 through RUNE2 + n-1.
  • MAPLOWER β€” defines the tolower mappings. RUNE2 is the lower case representation of RUNE1.
  • MAPUPPER β€” defines the toupper mappings. RUNE2 is the upper case representation of RUNE1.
  • TODIGIT β€” defines a map from runes to their digit value. RUNE2 is the integer value represented by RUNE1. for example, the ASCII character β€˜0’ would map to the decimal value 0. only values up to 255 are allowed. do NOT try to sneak 256 in there, she will know πŸ™ˆ

πŸ’– the property keywords (also can appear multiple times)

the following keywords may appear multiple times and have the following format for data:

RUNE              This rune has the property defined by the
                  keyword.

RUNE1 THRU RUNEn  All the runes between and including RUNE1 and
                  RUNEn have the property defined by the keyword.

and here's the whole squad:

  • ALPHA β€” defines runes which are alphabetic, printable and graphic.
  • CONTROL β€” defines runes which are control characters.
  • DIGIT β€” defines runes which are decimal digits, printable and graphic.
  • GRAPH β€” defines runes which are graphic and printable.
  • LOWER β€” defines runes which are lower case, printable and graphic.
  • PUNCT β€” defines runes which are punctuation, printable and graphic.
  • SPACE β€” defines runes which are spaces.
  • UPPER β€” defines runes which are upper case, printable and graphic.
  • XDIGIT β€” defines runes which are hexadecimal digits, printable and graphic.
  • BLANK β€” defines runes which are blank.
  • PRINT β€” defines runes which are printable.
  • IDEOGRAM β€” defines runes which are ideograms, printable and graphic.
  • SPECIAL β€” defines runes which are special characters, printable and graphic.
  • PHONOGRAM β€” defines runes which are phonograms, printable and graphic.
  • SWIDTH0 β€” defines runes with display width 0.
  • SWIDTH1 β€” defines runes with display width 1.
  • SWIDTH2 β€” defines runes with display width 2.
  • SWIDTH3 β€” defines runes with display width 3.
if no display width explicitly defined, width 1 assumed for printable runes by default. that's the fallback, bestie β€” she's got your back even when you forget to say anything πŸ’…

🌟 SEE ALSO 🌟

colldef(1), localedef(1), setlocale(3), wcwidth(3), big5(5), euc(5), gb18030(5), gb2312(5), gbk(5), mskanji(5), utf8(5)

the whole friend group, go say hi 🫢✨


πŸ“œ HISTORY πŸ“œ

the mklocale utility first appeared in 4.4BSD. a true vintage icon, we stan a legacy queen πŸ‘‘


πŸ’€ BUGS πŸ’€

the mklocale utility is overly simplistic.

not me being the one to say it but… yeah. she's simple. she's doing her best. love her anyway 😭


mklocale(1) β€” General Commands Manual β€” Debian β€” April 18, 2016

okay bye bestie, go make those locale files, drink some water, and remember: < starts your mapping, > ends it, and : is the delimiter. mwah πŸ’–πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from
  • nixpkgs unstable: adv_cmds 237
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms