|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.io.Reader
com.caucho.vfs.i18n.EncodingReader
com.caucho.vfs.i18n.WindowsHackReader
public class WindowsHackReader
Implements an encoding reader to convert the stupid windows "smart" quotes into ISO-8859-1 (Latin-1) characters.
The windows "smart" quotes actually do map into unicode characters. If that's what you want, use the window-1521 encoding instead. windows-hack converts to the closest latin-1 equivalent.
The three exceptions are the elipses '...', the trademark, and the per-mille characters. Those are translated into their unicode equivalents because there isn't a useful latin-1 equivalent.
Field Summary |
---|
Fields inherited from class java.io.Reader |
---|
lock |
Constructor Summary | |
---|---|
WindowsHackReader()
Null-arg constructor for instantiation by com.caucho.vfs.Encoding only. |
Method Summary | |
---|---|
java.io.Reader |
create(java.io.InputStream is,
java.lang.String javaEncoding)
Create a windows-hack reader based on the readStream. |
int |
read()
Reads into a character buffer using the correct encoding. |
int |
read(char[] cbuf,
int off,
int len)
Reads into a character buffer using the correct encoding. |
Methods inherited from class com.caucho.vfs.i18n.EncodingReader |
---|
close, create, getJavaEncoding, setJavaEncoding |
Methods inherited from class java.io.Reader |
---|
mark, markSupported, read, read, ready, reset, skip |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public WindowsHackReader()
Method Detail |
---|
public java.io.Reader create(java.io.InputStream is, java.lang.String javaEncoding)
create
in class EncodingReader
is
- the input stream providing the bytes.javaEncoding
- the JDK name for the encoding.
public int read() throws java.io.IOException
read
in class EncodingReader
java.io.IOException
public int read(char[] cbuf, int off, int len) throws java.io.IOException
read
in class EncodingReader
cbuf
- character buffer receiving the data.off
- starting offset into the buffer.len
- number of characters to read.
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |