public class HybridUTF8Charset
extends java.nio.charset.Charset
read unicode Code as name Undefined in all encodings, use the Unicode non-breaking zero width space 0x81 0x2060 zero width 0x90 0x2060 zero width Undefined in CP 1252, use definition in CP 1250 0x8D 0x0164 T caron 0x8F 0x0179 Z acute 0x9D 0x0165 t caron To simplify text processing, convert to the (almost) equivalent 7-bit character 0x92 0x0027 apostrophe in CP 1252: right single quotation mark 0x96 0x002D minus in CP 1252: en dash Use 8859-15 definition in preference to Unicode definition 0xA4 0x20AC Euro 0xA6 0x0160 S caron 0xA8 0x0161 s caron 0xB4 0x017D Z caron 0xB8 0x017E z caron 0xBC 0x0152 OE ligature 0xBD 0x0153 oe ligature 0xBE 0x0178 Y diaresisIf the above are inappropriate they can be changed with putValue(code, value). Codes C2 - F7 may be the first bytes of UTF-8 encodings of values with 8 to 21 bits. Subsequent bytes must be in the form 10xxxxxx. If the proper number of subsequent bytes are found, the sequence of 2, 3, or 4 are converted appropriately. See "Fallback and auto-detection" on page https://en.wikipedia.org/wiki/UTF-8. Since all characters are given some interpretation, the decoder never reports a malformed-input, an unmappable-character error, or underflow. It may throw an IllegalStateException to indicate programmer error..
Modifier and Type | Class and Description |
---|---|
static class |
HybridUTF8Charset.Hy8Reader
A Hy8Reader is a BufferedReader that uses the HybridUTF8 encoding.
|
static class |
HybridUTF8Charset.Hy8Writer
A class of object to be returned by HyWriter.
|
static class |
HybridUTF8Charset.HybridUTF8Decoder
Decoder for the HybridUTF8 Charset.
|
Modifier and Type | Field and Description |
---|---|
static HybridUTF8Charset |
hy8Charset
This Charset object is the factory for HybridUTF8 encoders and decoders.
|
Constructor and Description |
---|
HybridUTF8Charset() |
Modifier and Type | Method and Description |
---|---|
boolean |
contains(java.nio.charset.Charset cs) |
static byte[] |
encodeCharacter(char ch)
Encode a single character in its UTF-8 equivalent.
|
static HybridUTF8Charset.Hy8Reader |
hy8Reader(File f)
return a BufferedReader that uses the HybridUTF8 encoding.
|
static HybridUTF8Charset.Hy8Reader |
hy8Reader(InputStream is)
return a BufferedReader that uses the HybridUTF8 encoding.
|
static HybridUTF8Charset.Hy8Writer |
hy8Writer(File f)
Produce a BufferedWriter that reads a file in HybridUTF8 encoding.
|
static HybridUTF8Charset.Hy8Writer |
hy8Writer(OutputStream os)
Produce a BufferedWriter that writes to an OutputStream
in HybridUTF8 encoding.
|
HybridUTF8Charset.HybridUTF8Decoder |
newDecoder() |
java.nio.charset.CharsetEncoder |
newEncoder() |
public static final HybridUTF8Charset hy8Charset
public boolean contains(java.nio.charset.Charset cs)
contains
in class java.nio.charset.Charset
public HybridUTF8Charset.HybridUTF8Decoder newDecoder()
newDecoder
in class java.nio.charset.Charset
public java.nio.charset.CharsetEncoder newEncoder()
newEncoder
in class java.nio.charset.Charset
public static byte[] encodeCharacter(char ch)
ch
- The character to convert.public static HybridUTF8Charset.Hy8Reader hy8Reader(File f) throws IOException
f
- File describing the source file.IOException
- if file to read is not foundpublic static HybridUTF8Charset.Hy8Reader hy8Reader(InputStream is)
is
- The input stream to process.public static HybridUTF8Charset.Hy8Writer hy8Writer(File f) throws IOException
f
- A file to be read.IOException
- If thee is an IOError. Probably the wrong file is requested.public static HybridUTF8Charset.Hy8Writer hy8Writer(OutputStream os) throws IOException
os
- The OutputStream to write to.IOException
- If there is an IOError.