📄 euc.4
字号:
.\" Copyright (c) 1993.\" The Regents of the University of California. All rights reserved..\".\" This code is derived from software contributed to Berkeley by.\" Paul Borman at Krystal Technologies..\".\" Redistribution and use in source and binary forms, with or without.\" modification, are permitted provided that the following conditions.\" are met:.\" 1. Redistributions of source code must retain the above copyright.\" notice, this list of conditions and the following disclaimer..\" 2. Redistributions in binary form must reproduce the above copyright.\" notice, this list of conditions and the following disclaimer in the.\" documentation and/or other materials provided with the distribution..\" 3. All advertising materials mentioning features or use of this software.\" must display the following acknowledgement:.\" This product includes software developed by the University of.\" California, Berkeley and its contributors..\" 4. Neither the name of the University nor the names of its contributors.\" may be used to endorse or promote products derived from this software.\" without specific prior written permission..\".\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION).\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF.\" SUCH DAMAGE..\".\" @(#)euc.4 8.1 (Berkeley) 6/4/93.\".Dd "June 4, 1993".Dt EUC 4.Os.Sh NAME.Nm EUC.Nd EUC encoding of runes.Sh SYNOPSIS\fBENCODING "EUC"\fP.br\fBVARIABLE \fP\fIlen1 mask1 len2 mask2 len3 mask3 len4 mask4 mask\fP.Sh DESCRIPTIONThe.Nm EUCencoding is provided for compatibility with.Uxbased systems.See.Xr mklocale 1for a complete description of the.Ev LC_CTYPEsource file format..Pp.Nm EUCimplements a system of 4 multibyte codesets.A multibyte character in the first codeset consists of.Ar len1bytes starting with a byte in the range of 0x00 to 0x7f.To allow use of ASCII,.Ar len1is always 1.A multibyte character in the second codeset consists of.Ar len2bytes starting with a byte in the range of 0x80-0xff excluding 0x8e and 0x8f.A multibyte character in the third codeset consists of.Ar len3bytes starting with the byte 0x8e.A multibyte character in the fourth codeset consists of.Ar len4bytes starting with the byte 0x8f..PpThe .Ev rune_tencoding of.Nm EUCmultibyte characters is dependent on the.Ar lenand.Ar maskarguments.First, the bytes are moved into a.Ev rune_tas follows:.Bd -literalbyte0 << ((\fIlen\fPN-1) * 8) | byte1 << ((\fIlen\fPN-2) * 8) | ... | byte\fIlen\fPN-1.Ed.spThe result is then ANDed with.Ar ~maskand ORed with.Ar mask\fPN.Codesets 2 and 3 are special in that the leading byte (0x8e or 0x8f) isfirst removed and the.Ar len\fPNargument is reduced by 1..spFor example, the Japanese locale has the following.Ev VARIABLEline:.Bd -literalVARIABLE 1 0x0000 2 0x8080 2 0x0080 3 0x8000 0x8080.Ed.spCodeset 1 consists of the values 0x0000 - 0x007f..spCodeset 2 consists of the values who have the bits 0x8080 set..spCodeset 3 consists of the values 0x0080 - 0x00ff..spCodeset 4 consists of the values 0x8000 - 0xff7f excluding the valueswhich have the 0x0080 bit set..spNotice that the global.Ar maskis set to 0x8080, this implies that from those 2 bits the codeset canbe determined..Sh "EXAMPLE - Japanese Locale"This is a complete example of an.Ev LC_CTYPEsource file for the Japanese locale.Bd -literal/* * Japanese LOCALE_CTYPE definitions using EUC of JIS character sets */ENCODING "EUC"/* JIS JIS JIS *//* X201 X208 X201 *//* 00-7f 84-fe */VARIABLE 1 0x0000 2 0x8080 2 0x0080 3 0x8000 0x8080/* * Code Set 1 */ALPHA 'A' - 'Z' 'a' - 'z'CONTROL 0x00 - 0x1f 0x7fDIGIT '0' - '9'GRAPH 0x21 - 0x7eLOWER 'a' - 'z'PUNCT 0x21 - 0x2f 0x3a - 0x40 0x5b - 0x60 0x7b - 0x7eSPACE 0x09 - 0x0d 0x20UPPER 'A' - 'Z'XDIGIT 'a' - 'f' 'A' - 'F'BLANK ' ' '\t'PRINT 0x20 - 0x7eMAPLOWER < 'A' - 'Z' : 'a' > < 'a' - 'z' : 'a' >MAPUPPER < 'A' - 'Z' : 'A' > < 'a' - 'z' : 'A' >TODIGIT < '0' - '9' : 0 >TODIGIT < 'A' - 'F' : 10 > < 'a' - 'f' : 10 >/* * Code Set 2 */SPACE 0xa1a1PHONOGRAM 0xa1bcSPECIAL 0xa1a2 - 0xa1fePUNCT 0xa1a2 - 0xa1f8 /* A few too many in here... */SPECIAL 0xa2a1 - 0xa2ae 0xa2ba - 0xa2c1 0xa2ca - 0xa2d0 0xa2dc - 0xa2eaSPECIAL 0xa2f2 - 0xa2f9 0xa2feDIGIT 0xa3b0 - 0xa3b9UPPER 0xa3c1 - 0xa3da /* Romaji */LOWER 0xa3e1 - 0xa3fa /* Romaji */MAPLOWER < 0xa3c1 - 0xa3da : 0xa3e1 > /* English */MAPLOWER < 0xa3e1 - 0xa3fa : 0xa3e1 > /* English */MAPUPPER < 0xa3c1 - 0xa3da : 0xa3c1 >MAPUPPER < 0xa3e1 - 0xa3fa : 0xa3c1 >XDIGIT 0xa3c1 - 0xa3c6 0xa3e1 - 0xa3e6TODIGIT < 0xa3b0 - 0xa3b9 : 0 >TODIGIT < 0xa3c1 - 0xa3c6 : 10 > < 0xa3e1 - 0xa3e6 : 10 >PHONOGRAM 0xa4a1 - 0xa4f3PHONOGRAM 0xa5a1 - 0xa5f6UPPER 0xa6a1 - 0xa6b8 /* Greek */LOWER 0xa6c1 - 0xa6d8 /* Greek */MAPLOWER < 0xa6a1 - 0xa6b8 : 0xa6c1 > < 0xa6c1 - 0xa6d8 :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e 0xd9a1 - 0xd9feIDEOGRAM 0xdaa1 - 0xdafe 0xdba1 - 0xdbfe 0xdca1 - 0xdcfeIDEOGRAM 0xdda1 - 0xddfe 0xdea1 - 0xdefe 0xdfa1 - 0xdffeIDEOGRAM 0xe0a1 - 0xe0fe 0xe1a1 - 0xe1fe 0xe2a1 - 0xe2feIDEOGRAM 0xe3a1 - 0xe3fe 0xe4a1 - 0xe4fe 0xe5a1 - 0xe5feIDEOGRAM 0xe6a1 - 0xe6fe 0xe7a1 - 0xe7fe 0xe8a1 - 0xe8feIDEOGRAM 0xe9a1 - 0xe9fe 0xeaa1 - 0xeafe 0xeba1 - 0xebfeIDEOGRAM 0xeca1 - 0xecfe 0xeda1 - 0xedfe 0xeea1 - 0xeefeIDEOGRAM 0xefa1 - 0xeffe 0xf0a1 - 0xf0fe 0xf1a1 - 0xf1feIDEOGRAM 0xf2a1 - 0xf2fe 0xf3a1 - 0xf3fe 0xf4a1 - 0xf4a4/* * This is for Code Set 3, half-width kana */SPECIAL 0xa1 - 0xdfPHONOGRAM 0xa1 - 0xdfCONTROL 0x84 - 0x97 0x9b - 0x9f 0xe0 - 0xfe.Ed.Sh "SEE ALSO".Xr mklocale 1 ,.Xr setlocale 3
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -