public interface CodeCharset
Charset
etc. may be over engineered,
An important feature: report non-map-able characters, is missing.
The conversion between the ISO-8859-1 code page and UTF16 is very simple because it is the low part
of UTF-16, see ISO8859_1
.
All other code pages needs three tables with binary search for encoding, see ISO8859_2
etc.
In the moment only ISO8859-1 is supported.Modifier and Type | Field and Description |
---|---|
static CodeCharset |
ascii |
static java.util.Map<java.lang.String,CodeCharset> |
charsets |
static CodeCharset |
iso8859_1 |
Modifier and Type | Method and Description |
---|---|
static CodeCharset |
forName(java.lang.String name) |
char |
getChar(int code)
Converts from a 8-bit-code to a character
|
java.nio.charset.Charset |
getCharset() |
int |
getCode(char cc)
Converts from a UTC-16(Java-Character to a 8 bit coding.
|
static final java.util.Map<java.lang.String,CodeCharset> charsets
static final CodeCharset iso8859_1
static final CodeCharset ascii
int getCode(char cc)
cc
- the characterchar getChar(int code)
code
- in range 0..255, maybe >= 256 for UTF-8 sequences (The lowest byte is the first byte),
with max. 4 Byte (for not all UTF characters)java.nio.charset.Charset getCharset()
static CodeCharset forName(java.lang.String name)