Package io.github.zazalng.contracts
Enum DBFEncoding
- All Implemented Interfaces:
Serializable,Comparable<DBFEncoding>,java.lang.constant.Constable
Represents DBF Language Driver ID (LDID) encodings, which define the character set
used for text fields within the file.
This enum maps the single-byte code found in the DBF header (byte 29) to a
Java-compatible Charset name. The references are based on standard
xBase, dBASE, and Visual FoxPro documentation.
- Since:
- 1.0.0
- Author:
- Zazalng
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionLDID: 0xC8 - Eastern European Windows (windows-1250).LDID: 0xC9 - Russian Windows (windows-1251).LDID: 0x03 - Windows ANSI (windows-1252).LDID: 0x57 - ANSI (windows-1252).LDID: 0x58 - Western European ANSI (windows-1252).LDID: 0x59 - Spanish ANSI (windows-1252).LDID: 0xCB - Greek Windows (windows-1253).LDID: 0xCA - Turkish Windows (windows-1254).LDID: 0xCC - Baltic Windows (windows-1257).LDID: 0x01 - U.S.LDID: 0x09 - Dutch OEM (CP437).LDID: 0x0B - Finnish OEM (CP437).LDID: 0x0D - French OEM (CP437).LDID: 0x0F - German OEM (CP437).LDID: 0x11 - Italian OEM (CP437).LDID: 0x15 - Swedish OEM (CP437).LDID: 0x18 - Spanish OEM (CP437).LDID: 0x19 - English OEM (Britain) (CP437).LDID: 0x1B - English OEM (U.S.)LDID: 0x6A - Greek MS-DOS (437G) (CP737).LDID: 0x86 - Greek OEM (CP737).LDID: 0x02 - International MS-DOS (CP850).LDID: 0x0A - Dutch OEM* (CP850).LDID: 0x0E - French OEM* (CP850).LDID: 0x10 - German OEM* (CP850).LDID: 0x12 - Italian OEM* (CP850).LDID: 0x14 - Spanish OEM* (CP850).LDID: 0x16 - Swedish OEM* (CP850).LDID: 0x1A - English OEM (Britain)* (CP850).LDID: 0x1D - French OEM* (CP850).LDID: 0x25 - Portuguese OEM* (CP850).LDID: 0x37 - English OEM (U.S.)* (CP850).LDID: 0x1F - Czech OEM (CP852).LDID: 0x22 - Hungarian OEM (CP852).LDID: 0x23 - Polish OEM (CP852).LDID: 0x40 - Romanian OEM (CP852).LDID: 0x64 - Eastern European MS-DOS (CP852).LDID: 0x87 - Slovenian OEM (CP852).LDID: 0x6B - Turkish MS-DOS (CP857).LDID: 0x88 - Turkish OEM (CP857).LDID: 0x24 - Portuguese OEM (CP860).LDID: 0x67 - Icelandic MS-DOS (CP861).LDID: 0x1C - French OEM (Canada) (CP863).LDID: 0x6C - French-Canadian MS-DOS (CP863).LDID: 0x08 - Danish OEM (CP865).LDID: 0x17 - Norwegian OEM (CP865).LDID: 0x66 - Nordic MS-DOS (CP865).LDID: 0x26 - Russian OEM (CP866).LDID: 0x65 - Russian MS-DOS (CP866).LDID: 0x50 - Thai (ANSI/OEM) (x-windows-874).LDID: 0x7C - Thai Windows/MS-DOS (x-windows-874).LDID: 0x13 - Japanese Shift-JIS (MS932).LDID: 0x7B - Japanese Shift-JIS (MS932).LDID: 0x4D - Chinese GBK (PRC) (GBK).LDID: 0x7A - PRC GBK (GBK).LDID: 0x4E - Korean (ANSI/OEM) (x-windows-949).LDID: 0x79 - Hangul (Wansung) (x-windows-949).LDID: 0x4F - Chinese Big5 (Taiwan) (x-windows-950).LDID: 0x78 - Taiwan Big5 (x-windows-950).LDID: 0x00 - Default fallback, typically assumed to be Windows ANSI (windows-1252) when not specified. -
Method Summary
Modifier and TypeMethodDescriptionstatic DBFEncodingfromCode(int code) Retrieves theDBFEncodingenum constant corresponding to the given LDID code.Gets the Java-compatible character set name.intgetCode()Gets the Language Driver ID (LDID) code.Gets a human-readable description of the encoding.Converts the encoding name into aCharsetobject for I/O operations.toString()Provides a descriptive string representation of the encoding.static DBFEncodingReturns the enum constant of this type with the specified name.static DBFEncoding[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
CP437_01
LDID: 0x01 - U.S. MS-DOS (CP437). -
CP850_02
LDID: 0x02 - International MS-DOS (CP850). -
CP1252_03
LDID: 0x03 - Windows ANSI (windows-1252). -
CP865_08
LDID: 0x08 - Danish OEM (CP865). -
CP437_09
LDID: 0x09 - Dutch OEM (CP437). -
CP850_0A
LDID: 0x0A - Dutch OEM* (CP850). -
CP437_0B
LDID: 0x0B - Finnish OEM (CP437). -
CP437_0D
LDID: 0x0D - French OEM (CP437). -
CP850_0E
LDID: 0x0E - French OEM* (CP850). -
CP437_0F
LDID: 0x0F - German OEM (CP437). -
CP850_10
LDID: 0x10 - German OEM* (CP850). -
CP437_11
LDID: 0x11 - Italian OEM (CP437). -
CP850_12
LDID: 0x12 - Italian OEM* (CP850). -
CP932_13
LDID: 0x13 - Japanese Shift-JIS (MS932). -
CP850_14
LDID: 0x14 - Spanish OEM* (CP850). -
CP437_15
LDID: 0x15 - Swedish OEM (CP437). -
CP850_16
LDID: 0x16 - Swedish OEM* (CP850). -
CP865_17
LDID: 0x17 - Norwegian OEM (CP865). -
CP437_18
LDID: 0x18 - Spanish OEM (CP437). -
CP437_19
LDID: 0x19 - English OEM (Britain) (CP437). -
CP850_1A
LDID: 0x1A - English OEM (Britain)* (CP850). -
CP437_1B
LDID: 0x1B - English OEM (U.S.) (CP437). -
CP863_1C
LDID: 0x1C - French OEM (Canada) (CP863). -
CP850_1D
LDID: 0x1D - French OEM* (CP850). -
CP852_1F
LDID: 0x1F - Czech OEM (CP852). -
CP852_22
LDID: 0x22 - Hungarian OEM (CP852). -
CP852_23
LDID: 0x23 - Polish OEM (CP852). -
CP860_24
LDID: 0x24 - Portuguese OEM (CP860). -
CP850_25
LDID: 0x25 - Portuguese OEM* (CP850). -
CP866_26
LDID: 0x26 - Russian OEM (CP866). -
CP850_37
LDID: 0x37 - English OEM (U.S.)* (CP850). -
CP852_40
LDID: 0x40 - Romanian OEM (CP852). -
CP936_4D
LDID: 0x4D - Chinese GBK (PRC) (GBK). -
CP949_4E
LDID: 0x4E - Korean (ANSI/OEM) (x-windows-949). -
CP950_4F
LDID: 0x4F - Chinese Big5 (Taiwan) (x-windows-950). -
CP874_50
LDID: 0x50 - Thai (ANSI/OEM) (x-windows-874). -
CP1252_57
LDID: 0x57 - ANSI (windows-1252). -
CP1252_58
LDID: 0x58 - Western European ANSI (windows-1252). -
CP1252_59
LDID: 0x59 - Spanish ANSI (windows-1252). -
CP852_64
LDID: 0x64 - Eastern European MS-DOS (CP852). -
CP866_65
LDID: 0x65 - Russian MS-DOS (CP866). -
CP865_66
LDID: 0x66 - Nordic MS-DOS (CP865). -
CP861_67
LDID: 0x67 - Icelandic MS-DOS (CP861). -
CP737_6A
LDID: 0x6A - Greek MS-DOS (437G) (CP737). -
CP857_6B
LDID: 0x6B - Turkish MS-DOS (CP857). -
CP863_6C
LDID: 0x6C - French-Canadian MS-DOS (CP863). -
CP950_78
LDID: 0x78 - Taiwan Big5 (x-windows-950). -
CP949_79
LDID: 0x79 - Hangul (Wansung) (x-windows-949). -
CP936_7A
LDID: 0x7A - PRC GBK (GBK). -
CP932_7B
LDID: 0x7B - Japanese Shift-JIS (MS932). -
CP874_7C
LDID: 0x7C - Thai Windows/MS-DOS (x-windows-874). -
CP737_86
LDID: 0x86 - Greek OEM (CP737). -
CP852_87
LDID: 0x87 - Slovenian OEM (CP852). -
CP857_88
LDID: 0x88 - Turkish OEM (CP857). -
CP1250_C8
LDID: 0xC8 - Eastern European Windows (windows-1250). -
CP1251_C9
LDID: 0xC9 - Russian Windows (windows-1251). -
CP1254_CA
LDID: 0xCA - Turkish Windows (windows-1254). -
CP1253_CB
LDID: 0xCB - Greek Windows (windows-1253). -
CP1257_CC
LDID: 0xCC - Baltic Windows (windows-1257). -
UNKNOWN
LDID: 0x00 - Default fallback, typically assumed to be Windows ANSI (windows-1252) when not specified.
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
getCode
public int getCode()Gets the Language Driver ID (LDID) code.- Returns:
- The integer code (0x00 to 0xFF).
-
getCharsetName
Gets the Java-compatible character set name.- Returns:
- The string name of the character set (e.g., "CP437", "windows-1252").
-
getDescription
Gets a human-readable description of the encoding.- Returns:
- The description of the language/platform encoding.
-
toCharset
Converts the encoding name into aCharsetobject for I/O operations.- Returns:
- A
Charsetinstance.
-
fromCode
Retrieves theDBFEncodingenum constant corresponding to the given LDID code. Defaults toUNKNOWNif the code is not found.- Parameters:
code- The integer LDID code to look up.- Returns:
- The matching
DBFEncodingconstant.
-
toString
Provides a descriptive string representation of the encoding.- Overrides:
toStringin classEnum<DBFEncoding>- Returns:
- The enum name, hex code, and charset name.
-