diff options
author | Mark Wielaard <mark@klomp.org> | 2005-01-29 22:18:42 +0000 |
---|---|---|
committer | Mark Wielaard <mark@klomp.org> | 2005-01-29 22:18:42 +0000 |
commit | 72313cc4ac03a612709abf1a7bba40d431594632 (patch) | |
tree | d055c8f2e33a659492b61759f69970b5bf8eb110 | |
parent | bc9a426b38c0cef92dba1e3e23f5a8476cf577e4 (diff) | |
download | classpath-72313cc4ac03a612709abf1a7bba40d431594632.tar.gz |
2005-01-29 Quentin Anciaux <quentin.anciaux@advalvas.be>
* gnu/classpath/SystemProperties.java (static): Add all aliases
for UTF8, UTF16 and UTF32 (Little and Big Endian), US-ASCII,
iso-8859-[1-9], iso-8859-13, iso-8859-15, cp-1250, cp-1252 and
cp1047 to defaultProperties.
* gnu/java/io/decode/Decoder8859_13.java: New class.
* gnu/java/io/decode/Decoder8859_15.java: Likewise.
* gnu/java/io/decode/Decoder8859_6.java: Likewise.
* gnu/java/io/decode/Decoder8859_7.java: Likewise.
* gnu/java/io/decode/Decoder8859_8.java: Likewise.
* gnu/java/io/decode/Decoder8859_9.java: Likewise.
* gnu/java/io/decode/DecoderASCII.java: Likewise.
* gnu/java/io/decode/DecoderCp1047.java: Likewise.
* gnu/java/io/decode/DecoderEBCDIC_XML_US.java: Likewise.
* gnu/java/io/decode/DecoderUTF16BE.java: Likewise.
* gnu/java/io/decode/DecoderUTF16LE.java: Likewise.
* gnu/java/io/decode/DecoderUTF32BE.java: Likewise.
* gnu/java/io/decode/DecoderUTF32LE.java: Likewise.
* gnu/java/io/decode/DecoderWindows1250.java: Likewise.
* gnu/java/io/decode/DecoderWindows1252.java: Likewise.
* gnu/java/io/encode/Encoder8859_13.java: Likewise.
* gnu/java/io/encode/Encoder8859_15.java: Likewise.
* gnu/java/io/encode/Encoder8859_6.java: Likewise.
* gnu/java/io/encode/Encoder8859_7.java: Likewise.
* gnu/java/io/encode/Encoder8859_8.java: Likewise.
* gnu/java/io/encode/Encoder8859_9.java: Likewise.
* gnu/java/io/encode/EncoderASCII.java: Likewise.
* gnu/java/io/encode/EncoderCp1047.java: Likewise.
* gnu/java/io/encode/EncoderEBCDIC_XML_US.java: Likewise.
* gnu/java/io/encode/EncoderUTF16BE.java: Likewise.
* gnu/java/io/encode/EncoderUTF16LE.java: Likewise.
* gnu/java/io/encode/EncoderUTF32BE.java: Likewise.
* gnu/java/io/encode/EncoderUTF32LE.java: Likewise.
* gnu/java/io/encode/EncoderWindows1250.java: Likewise.
* gnu/java/io/encode/EncoderWindows1252.java: Likewise.
33 files changed, 5175 insertions, 112 deletions
@@ -1,3 +1,40 @@ +2005-01-29 Quentin Anciaux <quentin.anciaux@advalvas.be> + + * gnu/classpath/SystemProperties.java (static): Add all aliases + for UTF8, UTF16 and UTF32 (Little and Big Endian), US-ASCII, + iso-8859-[1-9], iso-8859-13, iso-8859-15, cp-1250, cp-1252 and + cp1047 to defaultProperties. + * gnu/java/io/decode/Decoder8859_13.java: New class. + * gnu/java/io/decode/Decoder8859_15.java: Likewise. + * gnu/java/io/decode/Decoder8859_6.java: Likewise. + * gnu/java/io/decode/Decoder8859_7.java: Likewise. + * gnu/java/io/decode/Decoder8859_8.java: Likewise. + * gnu/java/io/decode/Decoder8859_9.java: Likewise. + * gnu/java/io/decode/DecoderASCII.java: Likewise. + * gnu/java/io/decode/DecoderCp1047.java: Likewise. + * gnu/java/io/decode/DecoderEBCDIC_XML_US.java: Likewise. + * gnu/java/io/decode/DecoderUTF16BE.java: Likewise. + * gnu/java/io/decode/DecoderUTF16LE.java: Likewise. + * gnu/java/io/decode/DecoderUTF32BE.java: Likewise. + * gnu/java/io/decode/DecoderUTF32LE.java: Likewise. + * gnu/java/io/decode/DecoderWindows1250.java: Likewise. + * gnu/java/io/decode/DecoderWindows1252.java: Likewise. + * gnu/java/io/encode/Encoder8859_13.java: Likewise. + * gnu/java/io/encode/Encoder8859_15.java: Likewise. + * gnu/java/io/encode/Encoder8859_6.java: Likewise. + * gnu/java/io/encode/Encoder8859_7.java: Likewise. + * gnu/java/io/encode/Encoder8859_8.java: Likewise. + * gnu/java/io/encode/Encoder8859_9.java: Likewise. + * gnu/java/io/encode/EncoderASCII.java: Likewise. + * gnu/java/io/encode/EncoderCp1047.java: Likewise. + * gnu/java/io/encode/EncoderEBCDIC_XML_US.java: Likewise. + * gnu/java/io/encode/EncoderUTF16BE.java: Likewise. + * gnu/java/io/encode/EncoderUTF16LE.java: Likewise. + * gnu/java/io/encode/EncoderUTF32BE.java: Likewise. + * gnu/java/io/encode/EncoderUTF32LE.java: Likewise. + * gnu/java/io/encode/EncoderWindows1250.java: Likewise. + * gnu/java/io/encode/EncoderWindows1252.java: Likewise. + 2005-01-29 Steven Augart <augart@watson.ibm.com> * vm/reference/gnu/classpath/VMStackWalker.java: Doc fix. @@ -1,5 +1,10 @@ New in release 0.14 +* Character encoders and decoders have been added for: + iso-8859-6 (arabic), iso-8859-7 (greek), iso-8859-8 (hebrew), + iso-8859-9 (latin-5), iso-8859-13, iso-8859-15 (latin-9), cp1047 (ebcdic), + ebcdic-xml-us,ascii, windows-1250, windows-1252, UTF-16BE (Big Endian), + UTF-16LE (Little Endian), UTF-32BE (Big Endian), UTF-32LE (Little Endian). * VMSecurityManager has been replaced by gnu.classpath.VMStackWalker. currentClassLoader() is no longer needed, and there are also two new methods with non-native implementations. VM implementors are encouraged diff --git a/gnu/classpath/SystemProperties.java b/gnu/classpath/SystemProperties.java index fb2141a8b..aebf65375 100644 --- a/gnu/classpath/SystemProperties.java +++ b/gnu/classpath/SystemProperties.java @@ -1,5 +1,5 @@ /* SystemProperties.java -- Manage the System properties. - Copyright (C) 2004 Free Software Foundation + Copyright (C) 2004, 2005 Free Software Foundation This file is part of GNU Classpath. @@ -102,117 +102,395 @@ public class SystemProperties } // Common encoding aliases. See gnu.java.io.EncodingManager. - defaultProperties.put("gnu.java.io.encoding_scheme_alias.ISO8859_1", - "8859_1"); - - defaultProperties.put("gnu.java.io.encoding_scheme_alias.ISO-8859-1", - "8859_1"); - defaultProperties.put("gnu.java.io.encoding_scheme_alias.ISO-8859-2", - "8859_2"); - defaultProperties.put("gnu.java.io.encoding_scheme_alias.ISO-8859-3", - "8859_3"); - defaultProperties.put("gnu.java.io.encoding_scheme_alias.ISO-8859-4", - "8859_4"); - defaultProperties.put("gnu.java.io.encoding_scheme_alias.ISO-8859-5", - "8859_5"); - defaultProperties.put("gnu.java.io.encoding_scheme_alias.ISO-8859-6", - "8859_6"); - defaultProperties.put("gnu.java.io.encoding_scheme_alias.ISO-8859-7", - "8859_7"); - defaultProperties.put("gnu.java.io.encoding_scheme_alias.ISO-8859-8", - "8859_8"); - defaultProperties.put("gnu.java.io.encoding_scheme_alias.ISO-8859-9", - "8859_9"); - - defaultProperties.put("gnu.java.io.encoding_scheme_alias.iso-8859-1", - "8859_1"); - defaultProperties.put("gnu.java.io.encoding_scheme_alias.iso-8859-2", - "8859_2"); - defaultProperties.put("gnu.java.io.encoding_scheme_alias.iso-8859-3", - "8859_3"); - defaultProperties.put("gnu.java.io.encoding_scheme_alias.iso-8859-4", - "8859_4"); - defaultProperties.put("gnu.java.io.encoding_scheme_alias.iso-8859-5", - "8859_5"); - defaultProperties.put("gnu.java.io.encoding_scheme_alias.iso-8859-6", - "8859_6"); - defaultProperties.put("gnu.java.io.encoding_scheme_alias.iso-8859-7", - "8859_7"); - defaultProperties.put("gnu.java.io.encoding_scheme_alias.iso-8859-8", - "8859_8"); - defaultProperties.put("gnu.java.io.encoding_scheme_alias.iso-8859-9", - "8859_9"); - - defaultProperties.put("gnu.java.io.encoding_scheme_alias.iso8859_1", - "8859_1"); - defaultProperties.put("gnu.java.io.encoding_scheme_alias.iso8859_2", - "8859_2"); - defaultProperties.put("gnu.java.io.encoding_scheme_alias.iso8859_3", - "8859_3"); - defaultProperties.put("gnu.java.io.encoding_scheme_alias.iso8859_4", - "8859_4"); - defaultProperties.put("gnu.java.io.encoding_scheme_alias.iso8859_5", - "8859_5"); - defaultProperties.put("gnu.java.io.encoding_scheme_alias.iso8859_6", - "8859_6"); - defaultProperties.put("gnu.java.io.encoding_scheme_alias.iso8859_7", - "8859_7"); - defaultProperties.put("gnu.java.io.encoding_scheme_alias.iso8859_8", - "8859_8"); - defaultProperties.put("gnu.java.io.encoding_scheme_alias.iso8859_9", - "8859_9"); - - defaultProperties.put("gnu.java.io.encoding_scheme_alias.iso-latin-1", - "8859_1"); - defaultProperties.put("gnu.java.io.encoding_scheme_alias.iso-latin-2", - "8859_2"); - defaultProperties.put("gnu.java.io.encoding_scheme_alias.iso-latin-3", - "8859_3"); - defaultProperties.put("gnu.java.io.encoding_scheme_alias.iso-latin-4", - "8859_4"); - defaultProperties.put("gnu.java.io.encoding_scheme_alias.iso-latin-5", - "8859_5"); - defaultProperties.put("gnu.java.io.encoding_scheme_alias.iso-latin-6", - "8859_6"); - defaultProperties.put("gnu.java.io.encoding_scheme_alias.iso-latin-7", - "8859_7"); - defaultProperties.put("gnu.java.io.encoding_scheme_alias.iso-latin-8", - "8859_8"); - defaultProperties.put("gnu.java.io.encoding_scheme_alias.iso-latin-9", - "8859_9"); - - defaultProperties.put("gnu.java.io.encoding_scheme_alias.latin1", - "8859_1"); - defaultProperties.put("gnu.java.io.encoding_scheme_alias.latin2", - "8859_2"); - defaultProperties.put("gnu.java.io.encoding_scheme_alias.latin3", - "8859_3"); - defaultProperties.put("gnu.java.io.encoding_scheme_alias.latin4", - "8859_4"); - defaultProperties.put("gnu.java.io.encoding_scheme_alias.latin5", - "8859_5"); - defaultProperties.put("gnu.java.io.encoding_scheme_alias.latin6", - "8859_6"); - defaultProperties.put("gnu.java.io.encoding_scheme_alias.latin7", - "8859_7"); - defaultProperties.put("gnu.java.io.encoding_scheme_alias.latin8", - "8859_8"); - defaultProperties.put("gnu.java.io.encoding_scheme_alias.latin9", - "8859_9"); - - defaultProperties.put("gnu.java.io.encoding_scheme_alias.UTF-8", "UTF8"); - defaultProperties.put("gnu.java.io.encoding_scheme_alias.utf-8", "UTF8"); - - // XXX FIXME - Cheat a little for ASCII. - // Remove when we get a real "ASCII En/Decoder" - defaultProperties.put("gnu.java.io.encoding_scheme_alias.ASCII", "8859_1"); - defaultProperties.put("gnu.java.io.encoding_scheme_alias.ascii", "8859_1"); - defaultProperties.put("gnu.java.io.encoding_scheme_alias.US-ASCII", - "8859_1"); - defaultProperties.put("gnu.java.io.encoding_scheme_alias.us-ascii", - "8859_1"); - - // 8859_1 is a safe default encoding to use when not explicitly set + Properties dp = defaultProperties; + + //# UTF8 + dp.put("gnu.java.io.encoding_scheme_alias.utf8", "UTF8"); + dp.put("gnu.java.io.encoding_scheme_alias.UTF8", "UTF8"); + dp.put("gnu.java.io.encoding_scheme_alias.utf-8", "UTF8"); + dp.put("gnu.java.io.encoding_scheme_alias.UTF-8", "UTF8"); + dp.put("gnu.java.io.encoding_scheme_alias.ibm-1208", "UTF8"); + dp.put("gnu.java.io.encoding_scheme_alias.ibm-1209", "UTF8"); + dp.put("gnu.java.io.encoding_scheme_alias.ibm-5304", "UTF8"); + dp.put("gnu.java.io.encoding_scheme_alias.ibm-5305", "UTF8"); + dp.put("gnu.java.io.encoding_scheme_alias.windows-65001", "UTF8"); + dp.put("gnu.java.io.encoding_scheme_alias.cp1208", "UTF8"); + + //# UTF16 Little Endian + dp.put("gnu.java.io.encoding_scheme_alias.UTF16LE", "UTF16LE"); + dp.put("gnu.java.io.encoding_scheme_alias.utf16le", "UTF16LE"); + dp.put("gnu.java.io.encoding_scheme_alias.utf-16le", "UTF16LE"); + dp.put("gnu.java.io.encoding_scheme_alias.UTF-16LE", "UTF16LE"); + dp.put("gnu.java.io.encoding_scheme_alias.x-utf-16le", "UTF16LE"); + dp.put("gnu.java.io.encoding_scheme_alias.ibm-1202", "UTF16LE"); + dp.put("gnu.java.io.encoding_scheme_alias.ibm-13490", "UTF16LE"); + dp.put("gnu.java.io.encoding_scheme_alias.ibm-17586", "UTF16LE"); + dp.put("gnu.java.io.encoding_scheme_alias.UTF16_LittleEndian", + "UTF16LE"); + dp.put("gnu.java.io.encoding_scheme_alias.windows-1200", "UTF16LE"); + + //# UTF16 Big Endian + dp.put("gnu.java.io.encoding_scheme_alias.UTF16BE", "UTF16BE"); + dp.put("gnu.java.io.encoding_scheme_alias.utf16be", "UTF16BE"); + dp.put("gnu.java.io.encoding_scheme_alias.utf-16be", "UTF16BE"); + dp.put("gnu.java.io.encoding_scheme_alias.UTF-16BE", "UTF16BE"); + dp.put("gnu.java.io.encoding_scheme_alias.x-utf-16be", "UTF16BE"); + dp.put("gnu.java.io.encoding_scheme_alias.ibm-1200", "UTF16BE"); + dp.put("gnu.java.io.encoding_scheme_alias.ibm-1201", "UTF16BE"); + dp.put("gnu.java.io.encoding_scheme_alias.ibm-5297", "UTF16BE"); + dp.put("gnu.java.io.encoding_scheme_alias.ibm-13488", "UTF16BE"); + dp.put("gnu.java.io.encoding_scheme_alias.ibm-17584", "UTF16BE"); + dp.put("gnu.java.io.encoding_scheme_alias.windows-1201", "UTF16BE"); + dp.put("gnu.java.io.encoding_scheme_alias.cp1200", "UTF16BE"); + dp.put("gnu.java.io.encoding_scheme_alias.cp1201", "UTF16BE"); + dp.put("gnu.java.io.encoding_scheme_alias.UTF16_BigEndian", "UTF16BE"); + + //# UTF16 + dp.put("gnu.java.io.encoding_scheme_alias.UTF16", "UTF16BE"); + dp.put("gnu.java.io.encoding_scheme_alias.utf16", "UTF16BE"); + dp.put("gnu.java.io.encoding_scheme_alias.utf-16", "UTF16BE"); + dp.put("gnu.java.io.encoding_scheme_alias.UTF-16", "UTF16BE"); + dp.put("gnu.java.io.encoding_scheme_alias.ISO-10646-UCS-2", "UTF16BE"); + dp.put("gnu.java.io.encoding_scheme_alias.iso-10646-ucs-2", "UTF16BE"); + dp.put("gnu.java.io.encoding_scheme_alias.unicode", "UTF16BE"); + dp.put("gnu.java.io.encoding_scheme_alias.csUnicode", "UTF16BE"); + dp.put("gnu.java.io.encoding_scheme_alias.ucs-2", "UTF16BE"); + //# UTF32 Little Endian + dp.put("gnu.java.io.encoding_scheme_alias.UTF32LE", "UTF32LE"); + dp.put("gnu.java.io.encoding_scheme_alias.utf32le", "UTF32LE"); + dp.put("gnu.java.io.encoding_scheme_alias.utf-32le", "UTF32LE"); + dp.put("gnu.java.io.encoding_scheme_alias.UTF-32LE", "UTF32LE"); + dp.put("gnu.java.io.encoding_scheme_alias.UTF32_LittleEndian", + "UTF32LE"); + dp.put("gnu.java.io.encoding_scheme_alias.ibm-1234", "UTF32LE"); + + //# UTF32 Big Endian + dp.put("gnu.java.io.encoding_scheme_alias.UTF32BE", "UTF32BE"); + dp.put("gnu.java.io.encoding_scheme_alias.utf-32be", "UTF32BE"); + dp.put("gnu.java.io.encoding_scheme_alias.utf32be", "UTF32BE"); + dp.put("gnu.java.io.encoding_scheme_alias.UTF-32BE", "UTF32BE"); + dp.put("gnu.java.io.encoding_scheme_alias.UTF32_BigEndian", + "UTF32BE"); + dp.put("gnu.java.io.encoding_scheme_alias.ibm-1232", "UTF32BE"); + dp.put("gnu.java.io.encoding_scheme_alias.ibm-1233", "UTF32BE"); + + //# UTF32 + dp.put("gnu.java.io.encoding_scheme_alias.UTF32", "UTF32BE"); + dp.put("gnu.java.io.encoding_scheme_alias.utf-32", "UTF32BE"); + dp.put("gnu.java.io.encoding_scheme_alias.utf32", "UTF32BE"); + dp.put("gnu.java.io.encoding_scheme_alias.UTF-32", "UTF32BE"); + dp.put("gnu.java.io.encoding_scheme_alias.ISO-10646-UCS-4", + "UTF32BE"); + dp.put("gnu.java.io.encoding_scheme_alias.csUCS4", "UTF32BE"); + dp.put("gnu.java.io.encoding_scheme_alias.ucs-4", "UTF32BE"); + + //# US-ASCII + dp.put("gnu.java.io.encoding_scheme_alias.ASCII", "ASCII"); + dp.put("gnu.java.io.encoding_scheme_alias.US-ASCII", "ASCII"); + dp.put("gnu.java.io.encoding_scheme_alias.ascii", "ASCII"); + dp.put("gnu.java.io.encoding_scheme_alias.ANSI_X3.4-1968", "ASCII"); + dp.put("gnu.java.io.encoding_scheme_alias.ANSI_X3.4-1986", "ASCII"); + dp.put("gnu.java.io.encoding_scheme_alias.ISO_646.irv:1991", "ASCII"); + dp.put("gnu.java.io.encoding_scheme_alias.iso_646.irv:1983", "ASCII"); + dp.put("gnu.java.io.encoding_scheme_alias.ISO646-US", "ASCII"); + dp.put("gnu.java.io.encoding_scheme_alias.us", "ASCII"); + dp.put("gnu.java.io.encoding_scheme_alias.csASCII", "ASCII"); + dp.put("gnu.java.io.encoding_scheme_alias.iso-ir-6", "ASCII"); + dp.put("gnu.java.io.encoding_scheme_alias.cp367", "ASCII"); + dp.put("gnu.java.io.encoding_scheme_alias.ascii7", "ASCII"); + dp.put("gnu.java.io.encoding_scheme_alias.646", "ASCII"); + dp.put("gnu.java.io.encoding_scheme_alias.windows-20127", "ASCII"); + + //# iso-8859-1 (latin 1) + dp.put("gnu.java.io.encoding_scheme_alias.8859_1", "8859_1"); + dp.put("gnu.java.io.encoding_scheme_alias.ISO8859_1", "8859_1"); + dp.put("gnu.java.io.encoding_scheme_alias.iso8859_1", "8859_1"); + dp.put("gnu.java.io.encoding_scheme_alias.ISO_8859_1", "8859_1"); + dp.put("gnu.java.io.encoding_scheme_alias.iso_8859_1", "8859_1"); + dp.put("gnu.java.io.encoding_scheme_alias.ISO-8859-1", "8859_1"); + dp.put("gnu.java.io.encoding_scheme_alias.iso-8859-1", "8859_1"); + dp.put("gnu.java.io.encoding_scheme_alias.ibm-819", "8859_1"); + dp.put("gnu.java.io.encoding_scheme_alias.IBM819", "8859_1"); + dp.put("gnu.java.io.encoding_scheme_alias.cp819", "8859_1"); + dp.put("gnu.java.io.encoding_scheme_alias.Latin1", "8859_1"); + dp.put("gnu.java.io.encoding_scheme_alias.latin1", "8859_1"); + dp.put("gnu.java.io.encoding_scheme_alias.csISOLatin1", "8859_1"); + dp.put("gnu.java.io.encoding_scheme_alias.iso-ir-100", "8859_1"); + dp.put("gnu.java.io.encoding_scheme_alias.ISO_8859-1:1987", "8859_1"); + dp.put("gnu.java.io.encoding_scheme_alias.l1", "8859_1"); + dp.put("gnu.java.io.encoding_scheme_alias.819", "8859_1"); + + //# iso-8859-2 (latin 2) + dp.put("gnu.java.io.encoding_scheme_alias.8859_2", "8859_2"); + dp.put("gnu.java.io.encoding_scheme_alias.ibm-912_P100-1995", + "8859_2"); + dp.put("gnu.java.io.encoding_scheme_alias.ibm-912", "8859_2"); + dp.put("gnu.java.io.encoding_scheme_alias.iso_8859_2", "8859_2"); + dp.put("gnu.java.io.encoding_scheme_alias.ISO_8859_2", "8859_2"); + dp.put("gnu.java.io.encoding_scheme_alias.iso8859_2", "8859_2"); + dp.put("gnu.java.io.encoding_scheme_alias.ISO8859_2", "8859_2"); + dp.put("gnu.java.io.encoding_scheme_alias.iso-8859-2", "8859_2"); + dp.put("gnu.java.io.encoding_scheme_alias.ISO-8859-2", "8859_2"); + dp.put("gnu.java.io.encoding_scheme_alias.ISO_8859-2:1987", "8859_2"); + dp.put("gnu.java.io.encoding_scheme_alias.Latin2", "8859_2"); + dp.put("gnu.java.io.encoding_scheme_alias.latin2", "8859_2"); + dp.put("gnu.java.io.encoding_scheme_alias.csISOLatin2", "8859_2"); + dp.put("gnu.java.io.encoding_scheme_alias.iso-ir-101", "8859_2"); + dp.put("gnu.java.io.encoding_scheme_alias.l2", "8859_2"); + dp.put("gnu.java.io.encoding_scheme_alias.8859_2", "8859_2"); + dp.put("gnu.java.io.encoding_scheme_alias.cp912", "8859_2"); + dp.put("gnu.java.io.encoding_scheme_alias.912", "8859_2"); + dp.put("gnu.java.io.encoding_scheme_alias.windows-28592", "8859_2"); + + //# iso-8859-3 (latin 3) + dp.put("gnu.java.io.encoding_scheme_alias.8859_3", "8859_3"); + dp.put("gnu.java.io.encoding_scheme_alias.ibm-913_P100-2000", + "8859_3"); + dp.put("gnu.java.io.encoding_scheme_alias.ibm-913", "8859_3"); + dp.put("gnu.java.io.encoding_scheme_alias.iso_8859_3", "8859_3"); + dp.put("gnu.java.io.encoding_scheme_alias.ISO_8859_3", "8859_3"); + dp.put("gnu.java.io.encoding_scheme_alias.iso8859_3", "8859_3"); + dp.put("gnu.java.io.encoding_scheme_alias.ISO8859_3", "8859_3"); + dp.put("gnu.java.io.encoding_scheme_alias.iso-8859-3", "8859_3"); + dp.put("gnu.java.io.encoding_scheme_alias.ISO-8859-3", "8859_3"); + dp.put("gnu.java.io.encoding_scheme_alias.ISO_8859-3:1988", "8859_3"); + dp.put("gnu.java.io.encoding_scheme_alias.Latin3", "8859_3"); + dp.put("gnu.java.io.encoding_scheme_alias.latin3", "8859_3"); + dp.put("gnu.java.io.encoding_scheme_alias.csISOLatin3", "8859_3"); + dp.put("gnu.java.io.encoding_scheme_alias.iso-ir-109", "8859_3"); + dp.put("gnu.java.io.encoding_scheme_alias.l3", "8859_3"); + dp.put("gnu.java.io.encoding_scheme_alias.cp913", "8859_3"); + dp.put("gnu.java.io.encoding_scheme_alias.913", "8859_3"); + dp.put("gnu.java.io.encoding_scheme_alias.windows-28593", "8859_3"); + + //# iso-8859-4 (latin 4) + dp.put("gnu.java.io.encoding_scheme_alias.8859_4", "8859_4"); + dp.put("gnu.java.io.encoding_scheme_alias.ibm-914_P100-1995", + "8859_4"); + dp.put("gnu.java.io.encoding_scheme_alias.ibm-914", "8859_4"); + dp.put("gnu.java.io.encoding_scheme_alias.iso_8859_4", "8859_4"); + dp.put("gnu.java.io.encoding_scheme_alias.ISO_8859_4", "8859_4"); + dp.put("gnu.java.io.encoding_scheme_alias.iso8859_4", "8859_4"); + dp.put("gnu.java.io.encoding_scheme_alias.ISO8859_4", "8859_4"); + dp.put("gnu.java.io.encoding_scheme_alias.iso-8859-4", "8859_4"); + dp.put("gnu.java.io.encoding_scheme_alias.ISO-8859-4", "8859_4"); + dp.put("gnu.java.io.encoding_scheme_alias.Latin4", "8859_4"); + dp.put("gnu.java.io.encoding_scheme_alias.latin4", "8859_4"); + dp.put("gnu.java.io.encoding_scheme_alias.csISOLatin4", "8859_4"); + dp.put("gnu.java.io.encoding_scheme_alias.iso-ir-110", "8859_4"); + dp.put("gnu.java.io.encoding_scheme_alias.ISO_8859-4:1988", "8859_4"); + dp.put("gnu.java.io.encoding_scheme_alias.l4", "8859_4"); + dp.put("gnu.java.io.encoding_scheme_alias.cp914", "8859_4"); + dp.put("gnu.java.io.encoding_scheme_alias.914", "8859_4"); + dp.put("gnu.java.io.encoding_scheme_alias.windows-28594", "8859_4"); + + //# iso-8859-5 (cyrillic) + dp.put("gnu.java.io.encoding_scheme_alias.8859_5", "8859_5"); + dp.put("gnu.java.io.encoding_scheme_alias.ibm-915_P100-1995", + "8859_5"); + dp.put("gnu.java.io.encoding_scheme_alias.ibm-915", "8859_5"); + dp.put("gnu.java.io.encoding_scheme_alias.ISO_8859_5", "8859_5"); + dp.put("gnu.java.io.encoding_scheme_alias.iso_8859_5", "8859_5"); + dp.put("gnu.java.io.encoding_scheme_alias.ISO8859_5", "8859_5"); + dp.put("gnu.java.io.encoding_scheme_alias.iso8859_5", "8859_5"); + dp.put("gnu.java.io.encoding_scheme_alias.ISO-8859-5", "8859_5"); + dp.put("gnu.java.io.encoding_scheme_alias.iso-8859-5", "8859_5"); + dp.put("gnu.java.io.encoding_scheme_alias.cyrillic", "8859_5"); + dp.put("gnu.java.io.encoding_scheme_alias.csISOLatinCyrillic", + "8859_5"); + dp.put("gnu.java.io.encoding_scheme_alias.iso-ir-144", "8859_5"); + dp.put("gnu.java.io.encoding_scheme_alias.ISO_8859-5:1988", "8859_5"); + dp.put("gnu.java.io.encoding_scheme_alias.cp915", "8859_5"); + dp.put("gnu.java.io.encoding_scheme_alias.915", "8859_5"); + dp.put("gnu.java.io.encoding_scheme_alias.windows-28595", "8859_5"); + + //# iso-8859-6 (arabic) + dp.put("gnu.java.io.encoding_scheme_alias.8859_6", "8859_6"); + dp.put("gnu.java.io.encoding_scheme_alias.ibm-1089_P100-1995", + "8859_6"); + dp.put("gnu.java.io.encoding_scheme_alias.ibm-1089", "8859_6"); + dp.put("gnu.java.io.encoding_scheme_alias.ISO_8859_6", "8859_6"); + dp.put("gnu.java.io.encoding_scheme_alias.iso_8859_6", "8859_6"); + dp.put("gnu.java.io.encoding_scheme_alias.ISO8859_6", "8859_6"); + dp.put("gnu.java.io.encoding_scheme_alias.iso8859_6", "8859_6"); + dp.put("gnu.java.io.encoding_scheme_alias.ISO-8859-6", "8859_6"); + dp.put("gnu.java.io.encoding_scheme_alias.iso-8859-6", "8859_6"); + dp.put("gnu.java.io.encoding_scheme_alias.arabic", "8859_6"); + dp.put("gnu.java.io.encoding_scheme_alias.csISOLatinArabic", "8859_6"); + dp.put("gnu.java.io.encoding_scheme_alias.iso-ir-127", "8859_6"); + dp.put("gnu.java.io.encoding_scheme_alias.ISO_8859-6:1987", "8859_6"); + dp.put("gnu.java.io.encoding_scheme_alias.ECMA-114", "8859_6"); + dp.put("gnu.java.io.encoding_scheme_alias.ASMO-708", "8859_6"); + dp.put("gnu.java.io.encoding_scheme_alias.8859_6", "8859_6"); + dp.put("gnu.java.io.encoding_scheme_alias.cp1089", "8859_6"); + dp.put("gnu.java.io.encoding_scheme_alias.1089", "8859_6"); + dp.put("gnu.java.io.encoding_scheme_alias.windows-28596", "8859_6"); + dp.put("gnu.java.io.encoding_scheme_alias.ISO-8859-6-I", "8859_6"); + dp.put("gnu.java.io.encoding_scheme_alias.ISO-8859-6-E", "8859_6"); + + //# iso-8859-7 (greek) + dp.put("gnu.java.io.encoding_scheme_alias.8859_7", "8859_7"); + dp.put("gnu.java.io.encoding_scheme_alias.ibm-813_P100-1995", + "8859_7"); + dp.put("gnu.java.io.encoding_scheme_alias.ibm-813", "8859_7"); + dp.put("gnu.java.io.encoding_scheme_alias.ISO_8859_7", "8859_7"); + dp.put("gnu.java.io.encoding_scheme_alias.iso_8859_7", "8859_7"); + dp.put("gnu.java.io.encoding_scheme_alias.ISO8859_7", "8859_7"); + dp.put("gnu.java.io.encoding_scheme_alias.iso8859_7", "8859_7"); + dp.put("gnu.java.io.encoding_scheme_alias.ISO-8859-7", "8859_7"); + dp.put("gnu.java.io.encoding_scheme_alias.iso-8859-7", "8859_7"); + dp.put("gnu.java.io.encoding_scheme_alias.greek", "8859_7"); + dp.put("gnu.java.io.encoding_scheme_alias.greek8", "8859_7"); + dp.put("gnu.java.io.encoding_scheme_alias.ELOT_928", "8859_7"); + dp.put("gnu.java.io.encoding_scheme_alias.ECMA-118", "8859_7"); + dp.put("gnu.java.io.encoding_scheme_alias.csISOLatinGreek", "8859_7"); + dp.put("gnu.java.io.encoding_scheme_alias.iso-ir-126", "8859_7"); + dp.put("gnu.java.io.encoding_scheme_alias.ISO_8859-7:1987", "8859_7"); + dp.put("gnu.java.io.encoding_scheme_alias.cp813", "8859_7"); + dp.put("gnu.java.io.encoding_scheme_alias.813", "8859_7"); + dp.put("gnu.java.io.encoding_scheme_alias.windows-28597", "8859_7"); + + //# iso-8859-8 (hebrew) + dp.put("gnu.java.io.encoding_scheme_alias.8859_8", "8859_8"); + dp.put("gnu.java.io.encoding_scheme_alias.ibm-916_P100-1995", + "8859_8"); + dp.put("gnu.java.io.encoding_scheme_alias.ibm-916", "8859_8"); + dp.put("gnu.java.io.encoding_scheme_alias.ISO_8859_8", "8859_8"); + dp.put("gnu.java.io.encoding_scheme_alias.iso_8859_8", "8859_8"); + dp.put("gnu.java.io.encoding_scheme_alias.ISO8859_8", "8859_8"); + dp.put("gnu.java.io.encoding_scheme_alias.iso8859_8", "8859_8"); + dp.put("gnu.java.io.encoding_scheme_alias.ISO-8859-8", "8859_8"); + dp.put("gnu.java.io.encoding_scheme_alias.iso-8859-8", "8859_8"); + dp.put("gnu.java.io.encoding_scheme_alias.hebrew", "8859_8"); + dp.put("gnu.java.io.encoding_scheme_alias.csISOLatinHebrew", "8859_8"); + dp.put("gnu.java.io.encoding_scheme_alias.iso-ir-138", "8859_8"); + dp.put("gnu.java.io.encoding_scheme_alias.ISO_8859-8:1988", "8859_8"); + dp.put("gnu.java.io.encoding_scheme_alias.ISO-8859-8-I", "8859_8"); + dp.put("gnu.java.io.encoding_scheme_alias.ISO-8859-8-E", "8859_8"); + dp.put("gnu.java.io.encoding_scheme_alias.cp916", "8859_8"); + dp.put("gnu.java.io.encoding_scheme_alias.916", "8859_8"); + dp.put("gnu.java.io.encoding_scheme_alias.windows-28598", "8859_8"); + + //# iso-8859-9 (latin-5) + dp.put("gnu.java.io.encoding_scheme_alias.8859_9", "8859_9"); + dp.put("gnu.java.io.encoding_scheme_alias.ibm-920_P100-1995", + "8859_9"); + dp.put("gnu.java.io.encoding_scheme_alias.ibm-920", "8859_9"); + dp.put("gnu.java.io.encoding_scheme_alias.iso8859_9", "8859_9"); + dp.put("gnu.java.io.encoding_scheme_alias.ISO8859_9", "8859_9"); + dp.put("gnu.java.io.encoding_scheme_alias.iso-8859-9", "8859_9"); + dp.put("gnu.java.io.encoding_scheme_alias.ISO-8859-9", "8859_9"); + dp.put("gnu.java.io.encoding_scheme_alias.iso_8859_9", "8859_9"); + dp.put("gnu.java.io.encoding_scheme_alias.ISO_8859_9", "8859_9"); + dp.put("gnu.java.io.encoding_scheme_alias.latin5", "8859_9"); + dp.put("gnu.java.io.encoding_scheme_alias.Latin5", "8859_9"); + dp.put("gnu.java.io.encoding_scheme_alias.csISOLatin5", "8859_9"); + dp.put("gnu.java.io.encoding_scheme_alias.iso-ir-148", "8859_9"); + dp.put("gnu.java.io.encoding_scheme_alias.ISO_8859-9:1989", "8859_9"); + dp.put("gnu.java.io.encoding_scheme_alias.l5", "8859_9"); + dp.put("gnu.java.io.encoding_scheme_alias.cp920", "8859_9"); + dp.put("gnu.java.io.encoding_scheme_alias.920", "8859_9"); + dp.put("gnu.java.io.encoding_scheme_alias.windows-28599", "8859_9"); + dp.put("gnu.java.io.encoding_scheme_alias.ECMA-128", "8859_9"); + + //# iso-8859-13 + dp.put("gnu.java.io.encoding_scheme_alias.8859_13", "8859_13"); + dp.put("gnu.java.io.encoding_scheme_alias.ibm-921_P100-1995", + "8859_13"); + dp.put("gnu.java.io.encoding_scheme_alias.ibm-921", "8859_13"); + dp.put("gnu.java.io.encoding_scheme_alias.ISO_8859_13", "8859_13"); + dp.put("gnu.java.io.encoding_scheme_alias.iso_8859_13", "8859_13"); + dp.put("gnu.java.io.encoding_scheme_alias.ISO8859_13", "8859_13"); + dp.put("gnu.java.io.encoding_scheme_alias.iso8859_13", "8859_13"); + dp.put("gnu.java.io.encoding_scheme_alias.ISO-8859-13", "8859_13"); + dp.put("gnu.java.io.encoding_scheme_alias.iso-8859-13", "8859_13"); + dp.put("gnu.java.io.encoding_scheme_alias.8859_13", "8859_13"); + dp.put("gnu.java.io.encoding_scheme_alias.cp921", "8859_13"); + dp.put("gnu.java.io.encoding_scheme_alias.921", "8859_13"); + + //# iso-8859-15 (latin-9) + dp.put("gnu.java.io.encoding_scheme_alias.8859_15", "8859_15"); + dp.put("gnu.java.io.encoding_scheme_alias.ISO8859_15", "8859_15"); + dp.put("gnu.java.io.encoding_scheme_alias.iso8859_15", "8859_15"); + dp.put("gnu.java.io.encoding_scheme_alias.ISO-8859-15", "8859_15"); + dp.put("gnu.java.io.encoding_scheme_alias.iso-8859-15", "8859_15"); + dp.put("gnu.java.io.encoding_scheme_alias.8859-15", "8859_15"); + dp.put("gnu.java.io.encoding_scheme_alias.latin9", "8859_15"); + dp.put("gnu.java.io.encoding_scheme_alias.Latin9", "8859_15"); + dp.put("gnu.java.io.encoding_scheme_alias.ISO_8859_15", "8859_15"); + dp.put("gnu.java.io.encoding_scheme_alias.iso_8859_15", "8859_15"); + dp.put("gnu.java.io.encoding_scheme_alias.ibm-923_P100-1998", + "8859_15"); + dp.put("gnu.java.io.encoding_scheme_alias.ibm-923", "8859_15"); + dp.put("gnu.java.io.encoding_scheme_alias.Latin-9", "8859_15"); + dp.put("gnu.java.io.encoding_scheme_alias.l9", "8859_15"); + dp.put("gnu.java.io.encoding_scheme_alias.latin0", "8859_15"); + dp.put("gnu.java.io.encoding_scheme_alias.csisolatin0", "8859_15"); + dp.put("gnu.java.io.encoding_scheme_alias.csisolatin9", "8859_15"); + dp.put("gnu.java.io.encoding_scheme_alias.iso8859_15_fdis", "8859_15"); + dp.put("gnu.java.io.encoding_scheme_alias.cp923", "8859_15"); + dp.put("gnu.java.io.encoding_scheme_alias.923", "8859_15"); + dp.put("gnu.java.io.encoding_scheme_alias.windows-28605", "8859_15"); + + //# Windows-1252 (cp-1252) + dp.put("gnu.java.io.encoding_scheme_alias.Windows1252", "Windows1252"); + dp.put("gnu.java.io.encoding_scheme_alias.ibm-5348_P100-1997", + "Windows1252"); + dp.put("gnu.java.io.encoding_scheme_alias.ibm-5348", "Windows1252"); + dp.put("gnu.java.io.encoding_scheme_alias.windows-1252", + "Windows1252"); + dp.put("gnu.java.io.encoding_scheme_alias.Windows-1252", + "Windows1252"); + dp.put("gnu.java.io.encoding_scheme_alias.cp1252", "Windows1252"); + dp.put("gnu.java.io.encoding_scheme_alias.CP1252", "Windows1252"); + dp.put("gnu.java.io.encoding_scheme_alias.cp-1252", "Windows1252"); + dp.put("gnu.java.io.encoding_scheme_alias.CP-1252", "Windows1252"); + dp.put("gnu.java.io.encoding_scheme_alias.windows1252", "Windows1252"); + + //# Windows-1250 (cp-1250) + dp.put("gnu.java.io.encoding_scheme_alias.Windows1250", "Windows1250"); + dp.put("gnu.java.io.encoding_scheme_alias.ibm-5346_P100-1998", + "Windows1250"); + dp.put("gnu.java.io.encoding_scheme_alias.ibm-5346", "Windows1250"); + dp.put("gnu.java.io.encoding_scheme_alias.windows-1250", + "Windows1250"); + dp.put("gnu.java.io.encoding_scheme_alias.Windows-1250", + "Windows1250"); + dp.put("gnu.java.io.encoding_scheme_alias.cp1250", "Windows1250"); + dp.put("gnu.java.io.encoding_scheme_alias.CP1250", "Windows1250"); + dp.put("gnu.java.io.encoding_scheme_alias.cp-1250", "Windows1250"); + dp.put("gnu.java.io.encoding_scheme_alias.CP-1250", "Windows1250"); + dp.put("gnu.java.io.encoding_scheme_alias.windows1250", "Windows1250"); + + //# ebcdic-xml-us + dp.put("gnu.java.io.encoding_scheme_alias.EBCDIC_XML_US", + "EBCDIC_XML_US"); + dp.put("gnu.java.io.encoding_scheme_alias.ebcdic-xml-us", + "EBCDIC_XML_US"); + dp.put("gnu.java.io.encoding_scheme_alias.ebcdic", "EBCDIC_XML_US"); + dp.put("gnu.java.io.encoding_scheme_alias.EBCDIC", "EBCDIC_XML_US"); + dp.put("gnu.java.io.encoding_scheme_alias.EBCDIC-XML-US", + "EBCDIC_XML_US"); + dp.put("gnu.java.io.encoding_scheme_alias.ebcdic_xml_us", + "EBCDIC_XML_US"); + + //# ebcdic latin 1 (cp1047) + dp.put("gnu.java.io.encoding_scheme_alias.Cp1047", "Cp1047"); + dp.put("gnu.java.io.encoding_scheme_alias.ibm-1047_P100-1995", + "Cp1047"); + dp.put("gnu.java.io.encoding_scheme_alias.ibm-1047", "Cp1047"); + dp.put("gnu.java.io.encoding_scheme_alias.IBM1047", "Cp1047"); + dp.put("gnu.java.io.encoding_scheme_alias.cpibm1047", "Cp1047"); + dp.put("gnu.java.io.encoding_scheme_alias.cp1047", "Cp1047"); + dp.put("gnu.java.io.encoding_scheme_alias.CP1047", "Cp1047"); + dp.put("gnu.java.io.encoding_scheme_alias.cp-1047", "Cp1047"); + dp.put("gnu.java.io.encoding_scheme_alias.CP-1047", "Cp1047"); + dp.put("gnu.java.io.encoding_scheme_alias.ebcdic1047", "Cp1047"); + dp.put("gnu.java.io.encoding_scheme_alias.EBCDIC1047", "Cp1047"); + dp.put("gnu.java.io.encoding_scheme_alias.ebcdic-1047", "Cp1047"); + dp.put("gnu.java.io.encoding_scheme_alias.EBCDIC-1047", "Cp1047"); + + // 8859_1 is a safe default encoding to use when not explicitly set if (defaultProperties.get("file.encoding") == null) defaultProperties.put("file.encoding", "8859_1"); diff --git a/gnu/java/io/decode/Decoder8859_13.java b/gnu/java/io/decode/Decoder8859_13.java new file mode 100644 index 000000000..2ebd37749 --- /dev/null +++ b/gnu/java/io/decode/Decoder8859_13.java @@ -0,0 +1,100 @@ +/* Decoder8859_13.java -- Decoder for ISO-8859-13 Character set. + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package gnu.java.io.decode; + +import java.io.InputStream; + +/** + * This class decodes bytes in ISO-8859-13 format to Unicode. 8859_13 + * ibm-921_P100-1995 ibm-921 ISO_8859_13 iso_8859_13 ISO8859_13 iso8859_13 + * ISO-8859-13 iso-8859-13 8859_13 cp921 921 + * + * @version 0.0 + * @author Quentin Anciaux (quentin.anciaux@advalvas.be) + * @author based on gnu.java.io.decode.Decoder8859_1 by Aaron M. Renn + * (arenn@urbanophile.com) + */ +public class Decoder8859_13 extends DecoderEightBitLookup +{ + + /** + * This is the lookup table for this encoding + */ + private static final char[] lookup_table_8859_13 = + { 0x0000, 0x0001, + 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, + 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F, 0x0010, 0x0011, + 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, + 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F, 0x0020, 0x0021, + 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, + 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F, 0x0030, 0x0031, + 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, + 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F, 0x0040, 0x0041, + 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, + 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F, 0x0050, 0x0051, + 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, + 0x005A, 0x005B, 0x005C, 0x005D, 0x005E, 0x005F, 0x0060, 0x0061, + 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, + 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, 0x0070, 0x0071, + 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, + 0x007A, 0x007B, 0x007C, 0x007D, 0x007E, 0x007F, 0x0080, 0x0081, + 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 0x0088, 0x0089, + 0x008A, 0x008B, 0x008C, 0x008D, 0x008E, 0x008F, 0x0090, 0x0091, + 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 0x0098, 0x0099, + 0x009A, 0x009B, 0x009C, 0x009D, 0x009E, 0x009F, 0x00A0, 0x201D, + 0x00A2, 0x00A3, 0x00A4, 0x201E, 0x00A6, 0x00A7, 0x00D8, 0x00A9, + 0x0156, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00C6, 0x00B0, 0x00B1, + 0x00B2, 0x00B3, 0x201C, 0x00B5, 0x00B6, 0x00B7, 0x00F8, 0x00B9, + 0x0157, 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0x00E6, 0x0104, 0x012E, + 0x0100, 0x0106, 0x00C4, 0x00C5, 0x0118, 0x0112, 0x010C, 0x00C9, + 0x0179, 0x0116, 0x0122, 0x0136, 0x012A, 0x013B, 0x0160, 0x0143, + 0x0145, 0x00D3, 0x014C, 0x00D5, 0x00D6, 0x00D7, 0x0172, 0x0141, + 0x015A, 0x016A, 0x00DC, 0x017B, 0x017D, 0x00DF, 0x0105, 0x012F, + 0x0101, 0x0107, 0x00E4, 0x00E5, 0x0119, 0x0113, 0x010D, 0x00E9, + 0x017A, 0x0117, 0x0123, 0x0137, 0x012B, 0x013C, 0x0161, 0x0144, + 0x0146, 0x00F3, 0x014D, 0x00F5, 0x00F6, 0x00F7, 0x0173, 0x0142, + 0x015B, 0x016B, 0x00FC, 0x017C, 0x017E, 0x2019 }; + + public Decoder8859_13(InputStream in) + { + super(in, "8859_13", lookup_table_8859_13); + } + +} // class Decoder8859_13 + diff --git a/gnu/java/io/decode/Decoder8859_15.java b/gnu/java/io/decode/Decoder8859_15.java new file mode 100644 index 000000000..0e9f1e856 --- /dev/null +++ b/gnu/java/io/decode/Decoder8859_15.java @@ -0,0 +1,101 @@ +/* Decoder8859_15.java -- Decoder for ISO-Latin-9 Character set. + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package gnu.java.io.decode; + +import java.io.InputStream; + +/** + * This class decodes bytes in ISO-8859-15 (Latin-9) format to Unicode. + * ISO-8859-15 iso-8859-15 8859-15 8859_15 latin9 Latin9 ISO_8859_15 + * iso_8859_15 ibm-923_P100-1998 ibm-923 Latin-9 l9 8859_15 latin0 + * csisolatin0 csisolatin9 iso8859_15_fdis cp923 923 windows-28605 + * + * @version 0.0 + * @author Quentin Anciaux (quentin.anciaux@advalvas.be) + * @author based on gnu.java.io.decode.Decoder8859_1 by Aaron M. Renn + * (arenn@urbanophile.com) + */ +public class Decoder8859_15 extends DecoderEightBitLookup +{ + + /** + * This is the lookup table for this encoding + */ + private static final char[] lookup_table_8859_15 = + { 0x0000, 0x0001, + 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, + 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F, 0x0010, 0x0011, + 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, + 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F, 0x0020, 0x0021, + 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, + 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F, 0x0030, 0x0031, + 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, + 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F, 0x0040, 0x0041, + 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, + 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F, 0x0050, 0x0051, + 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, + 0x005A, 0x005B, 0x005C, 0x005D, 0x005E, 0x005F, 0x0060, 0x0061, + 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, + 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, 0x0070, 0x0071, + 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, + 0x007A, 0x007B, 0x007C, 0x007D, 0x007E, 0x007F, 0x0080, 0x0081, + 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 0x0088, 0x0089, + 0x008A, 0x008B, 0x008C, 0x008D, 0x008E, 0x008F, 0x0090, 0x0091, + 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 0x0098, 0x0099, + 0x009A, 0x009B, 0x009C, 0x009D, 0x009E, 0x009F, 0x00A0, 0x00A1, + 0x00A2, 0x00A3, 0x20AC, 0x00A5, 0x0160, 0x00A7, 0x0161, 0x00A9, + 0x00AA, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00AF, 0x00B0, 0x00B1, + 0x00B2, 0x00B3, 0x017D, 0x00B5, 0x00B6, 0x00B7, 0x017E, 0x00B9, + 0x00BA, 0x00BB, 0x0152, 0x0153, 0x0178, 0x00BF, 0x00C0, 0x00C1, + 0x00C2, 0x00C3, 0x00C4, 0x00C5, 0x00C6, 0x00C7, 0x00C8, 0x00C9, + 0x00CA, 0x00CB, 0x00CC, 0x00CD, 0x00CE, 0x00CF, 0x00D0, 0x00D1, + 0x00D2, 0x00D3, 0x00D4, 0x00D5, 0x00D6, 0x00D7, 0x00D8, 0x00D9, + 0x00DA, 0x00DB, 0x00DC, 0x00DD, 0x00DE, 0x00DF, 0x00E0, 0x00E1, + 0x00E2, 0x00E3, 0x00E4, 0x00E5, 0x00E6, 0x00E7, 0x00E8, 0x00E9, + 0x00EA, 0x00EB, 0x00EC, 0x00ED, 0x00EE, 0x00EF, 0x00F0, 0x00F1, + 0x00F2, 0x00F3, 0x00F4, 0x00F5, 0x00F6, 0x00F7, 0x00F8, 0x00F9, + 0x00FA, 0x00FB, 0x00FC, 0x00FD, 0x00FE, 0x00FF }; + + public Decoder8859_15(InputStream in) + { + super(in, "8859_15", lookup_table_8859_15); + } + +} // class Decoder8859_15 + diff --git a/gnu/java/io/decode/Decoder8859_6.java b/gnu/java/io/decode/Decoder8859_6.java new file mode 100644 index 000000000..44d58cd40 --- /dev/null +++ b/gnu/java/io/decode/Decoder8859_6.java @@ -0,0 +1,345 @@ +/* Decoder8859_6.java -- Decoder for ISO-8859-6 Character set + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package gnu.java.io.decode; + +import java.io.InputStream; + +/** + * This class decodes bytes in ISO-8859-6 format to Unicode. + * + * 8859_6 + * ibm-1089_P100-1995 + * ibm-1089 + * ISO_8859_6 + * iso_8859_6 + * ISO8859_6 + * iso8859_6 + * ISO-8859-6 + * iso-8859-6 + * arabic + * csISOLatinArabic + * iso-ir-127 + * ISO_8859-6:1987 + * ECMA-114 + * ASMO-708 + * 8859_6 + * cp1089 + * 1089 + * windows-28596 + * ISO-8859-6-I + * ISO-8859-6-E + * + * @version 0.0 + * + * @author Quentin Anciaux (quentin.anciaux@advalvas.be) + * @author based on gnu.java.io.decode.Decoder8859_1 by + * Aaron M. Renn (arenn@urbanophile.com) + */ +public class Decoder8859_6 extends DecoderEightBitLookup +{ + + /** + * This is the lookup table for this encoding + */ + private static final char[] lookup_table_8859_6 = { + 0x0000, + 0x0001, + 0x0002, + 0x0003, + 0x0004, + 0x0005, + 0x0006, + 0x0007, + 0x0008, + 0x0009, + 0x000A, + 0x000B, + 0x000C, + 0x000D, + 0x000E, + 0x000F, + 0x0010, + 0x0011, + 0x0012, + 0x0013, + 0x0014, + 0x0015, + 0x0016, + 0x0017, + 0x0018, + 0x0019, + 0x001A, + 0x001B, + 0x001C, + 0x001D, + 0x001E, + 0x001F, + 0x0020, + 0x0021, + 0x0022, + 0x0023, + 0x0024, + 0x0025, + 0x0026, + 0x0027, + 0x0028, + 0x0029, + 0x002A, + 0x002B, + 0x002C, + 0x002D, + 0x002E, + 0x002F, + 0x0030, + 0x0031, + 0x0032, + 0x0033, + 0x0034, + 0x0035, + 0x0036, + 0x0037, + 0x0038, + 0x0039, + 0x003A, + 0x003B, + 0x003C, + 0x003D, + 0x003E, + 0x003F, + 0x0040, + 0x0041, + 0x0042, + 0x0043, + 0x0044, + 0x0045, + 0x0046, + 0x0047, + 0x0048, + 0x0049, + 0x004A, + 0x004B, + 0x004C, + 0x004D, + 0x004E, + 0x004F, + 0x0050, + 0x0051, + 0x0052, + 0x0053, + 0x0054, + 0x0055, + 0x0056, + 0x0057, + 0x0058, + 0x0059, + 0x005A, + 0x005B, + 0x005C, + 0x005D, + 0x005E, + 0x005F, + 0x0060, + 0x0061, + 0x0062, + 0x0063, + 0x0064, + 0x0065, + 0x0066, + 0x0067, + 0x0068, + 0x0069, + 0x006A, + 0x006B, + 0x006C, + 0x006D, + 0x006E, + 0x006F, + 0x0070, + 0x0071, + 0x0072, + 0x0073, + 0x0074, + 0x0075, + 0x0076, + 0x0077, + 0x0078, + 0x0079, + 0x007A, + 0x007B, + 0x007C, + 0x007D, + 0x007E, + 0x007F, + 0x0080, + 0x0081, + 0x0082, + 0x0083, + 0x0084, + 0x0085, + 0x0086, + 0x0087, + 0x0088, + 0x0089, + 0x008A, + 0x008B, + 0x008C, + 0x008D, + 0x008E, + 0x008F, + 0x0090, + 0x0091, + 0x0092, + 0x0093, + 0x0094, + 0x0095, + 0x0096, + 0x0097, + 0x0098, + 0x0099, + 0x009A, + 0x009B, + 0x009C, + 0x009D, + 0x009E, + 0x009F, + 0x00A0, + 0x0000, + 0x0000, + 0x0000, + 0x00A4, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x060C, + 0x00AD, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x061B, + 0x0000, + 0x0000, + 0x0000, + 0x061F, + 0x0000, + 0x0621, + 0x0622, + 0x0623, + 0x0624, + 0x0625, + 0x0626, + 0x0627, + 0x0628, + 0x0629, + 0x062A, + 0x062B, + 0x062C, + 0x062D, + 0x062E, + 0x062F, + 0x0630, + 0x0631, + 0x0632, + 0x0633, + 0x0634, + 0x0635, + 0x0636, + 0x0637, + 0x0638, + 0x0639, + 0x063A, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0640, + 0x0641, + 0x0642, + 0x0643, + 0x0644, + 0x0645, + 0x0646, + 0x0647, + 0x0648, + 0x0649, + 0x064A, + 0x064B, + 0x064C, + 0x064D, + 0x064E, + 0x064F, + 0x0650, + 0x0651, + 0x0652, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000 + }; + + public Decoder8859_6(InputStream in) + { + super(in, "8859_6", lookup_table_8859_6); + } + +} // class Decoder8859_6 + diff --git a/gnu/java/io/decode/Decoder8859_7.java b/gnu/java/io/decode/Decoder8859_7.java new file mode 100644 index 000000000..46d40a37d --- /dev/null +++ b/gnu/java/io/decode/Decoder8859_7.java @@ -0,0 +1,101 @@ +/* Decoder8859_7.java -- Decoder for ISO-8859-7 Character set. + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package gnu.java.io.decode; + +import java.io.InputStream; + +/** + * This class decodes bytes in ISO-8859-7 format to Unicode. 8859_7 + * ibm-813_P100-1995 ibm-813 ISO_8859_7 iso_8859_7 ISO8859_7 iso8859_7 + * ISO-8859-7 iso-8859-7 greek greek8 ELOT_928 ECMA-118 csISOLatinGreek + * iso-ir-126 ISO_8859-7:1987 cp813 813 windows-28597 + * + * @version 0.0 + * @author Quentin Anciaux (quentin.anciaux@advalvas.be) + * @author based on gnu.java.io.decode.Decoder8859_1 by Aaron M. Renn + * (arenn@urbanophile.com) + */ +public class Decoder8859_7 extends DecoderEightBitLookup +{ + + /** + * This is the lookup table for this encoding + */ + private static final char[] lookup_table_8859_7 = + { 0x0000, 0x0001, 0x0002, + 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000A, + 0x000B, 0x000C, 0x000D, 0x000E, 0x000F, 0x0010, 0x0011, 0x0012, + 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001A, + 0x001B, 0x001C, 0x001D, 0x001E, 0x001F, 0x0020, 0x0021, 0x0022, + 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002A, + 0x002B, 0x002C, 0x002D, 0x002E, 0x002F, 0x0030, 0x0031, 0x0032, + 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003A, + 0x003B, 0x003C, 0x003D, 0x003E, 0x003F, 0x0040, 0x0041, 0x0042, + 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004A, + 0x004B, 0x004C, 0x004D, 0x004E, 0x004F, 0x0050, 0x0051, 0x0052, + 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005A, + 0x005B, 0x005C, 0x005D, 0x005E, 0x005F, 0x0060, 0x0061, 0x0062, + 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006A, + 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, 0x0070, 0x0071, 0x0072, + 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007A, + 0x007B, 0x007C, 0x007D, 0x007E, 0x007F, 0x0080, 0x0081, 0x0082, + 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 0x0088, 0x0089, 0x008A, + 0x008B, 0x008C, 0x008D, 0x008E, 0x008F, 0x0090, 0x0091, 0x0092, + 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 0x0098, 0x0099, 0x009A, + 0x009B, 0x009C, 0x009D, 0x009E, 0x009F, 0x00A0, 0x2018, 0x2019, + 0x00A3, 0x0000, 0x0000, 0x00A6, 0x00A7, 0x00A8, 0x00A9, 0x0000, + 0x00AB, 0x00AC, 0x00AD, 0x0000, 0x2015, 0x00B0, 0x00B1, 0x00B2, + 0x00B3, 0x00B4, 0x0385, 0x0386, 0x0387, 0x0388, 0x0389, 0x038A, + 0x00BB, 0x038C, 0x00BD, 0x038E, 0x038F, 0x0390, 0x0391, 0x0392, + 0x0393, 0x0394, 0x0395, 0x0396, 0x0397, 0x0398, 0x0399, 0x039A, + 0x039B, 0x039C, 0x039D, 0x039E, 0x039F, 0x03A0, 0x03A1, 0x0000, + 0x03A3, 0x03A4, 0x03A5, 0x03A6, 0x03A7, 0x03A8, 0x03A9, 0x03AA, + 0x03AB, 0x03AC, 0x03AD, 0x03AE, 0x03AF, 0x03B0, 0x03B1, 0x03B2, + 0x03B3, 0x03B4, 0x03B5, 0x03B6, 0x03B7, 0x03B8, 0x03B9, 0x03BA, + 0x03BB, 0x03BC, 0x03BD, 0x03BE, 0x03BF, 0x03C0, 0x03C1, 0x03C2, + 0x03C3, 0x03C4, 0x03C5, 0x03C6, 0x03C7, 0x03C8, 0x03C9, 0x03CA, + 0x03CB, 0x03CC, 0x03CD, 0x03CE, 0x0000 }; + + public Decoder8859_7(InputStream in) + { + super(in, "8859_7", lookup_table_8859_7); + } + +} // class Decoder8859_7 + diff --git a/gnu/java/io/decode/Decoder8859_8.java b/gnu/java/io/decode/Decoder8859_8.java new file mode 100644 index 000000000..a458b51c0 --- /dev/null +++ b/gnu/java/io/decode/Decoder8859_8.java @@ -0,0 +1,101 @@ +/* Decoder8859_8.java -- Decoder for ISO-8859-8 Character set. + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package gnu.java.io.decode; + +import java.io.InputStream; + +/** + * This class decodes bytes in ISO-8859-8 format to Unicode. 8859_8 + * ibm-916_P100-1995 ibm-916 ISO_8859_8 iso_8859_8 ISO8859_8 iso8859_8 + * ISO-8859-8 iso-8859-8 hebrew csISOLatinHebrew iso-ir-138 ISO_8859-8:1988 + * ISO-8859-8-I ISO-8859-8-E cp916 916 windows-28598 + * + * @version 0.0 + * @author Quentin Anciaux (quentin.anciaux@advalvas.be) + * @author based on gnu.java.io.decode.Decoder8859_1 by Aaron M. Renn + * (arenn@urbanophile.com) + */ +public class Decoder8859_8 extends DecoderEightBitLookup +{ + + /** + * This is the lookup table for this encoding + */ + private static final char[] lookup_table_8859_8 = + { 0x0000, 0x0001, 0x0002, + 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000A, + 0x000B, 0x000C, 0x000D, 0x000E, 0x000F, 0x0010, 0x0011, 0x0012, + 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001A, + 0x001B, 0x001C, 0x001D, 0x001E, 0x001F, 0x0020, 0x0021, 0x0022, + 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002A, + 0x002B, 0x002C, 0x002D, 0x002E, 0x002F, 0x0030, 0x0031, 0x0032, + 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003A, + 0x003B, 0x003C, 0x003D, 0x003E, 0x003F, 0x0040, 0x0041, 0x0042, + 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004A, + 0x004B, 0x004C, 0x004D, 0x004E, 0x004F, 0x0050, 0x0051, 0x0052, + 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005A, + 0x005B, 0x005C, 0x005D, 0x005E, 0x005F, 0x0060, 0x0061, 0x0062, + 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006A, + 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, 0x0070, 0x0071, 0x0072, + 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007A, + 0x007B, 0x007C, 0x007D, 0x007E, 0x007F, 0x0080, 0x0081, 0x0082, + 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 0x0088, 0x0089, 0x008A, + 0x008B, 0x008C, 0x008D, 0x008E, 0x008F, 0x0090, 0x0091, 0x0092, + 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 0x0098, 0x0099, 0x009A, + 0x009B, 0x009C, 0x009D, 0x009E, 0x009F, 0x00A0, 0x0000, 0x00A2, + 0x00A3, 0x00A4, 0x00A5, 0x00A6, 0x00A7, 0x00A8, 0x00A9, 0x00D7, + 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x203E, 0x00B0, 0x00B1, 0x00B2, + 0x00B3, 0x00B4, 0x00B5, 0x00B6, 0x2022, 0x00B8, 0x00B9, 0x00F7, + 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x2017, 0x05D0, 0x05D1, 0x05D2, + 0x05D3, 0x05D4, 0x05D5, 0x05D6, 0x05D7, 0x05D8, 0x05D9, 0x05DA, + 0x05DB, 0x05DC, 0x05DD, 0x05DE, 0x05DF, 0x05E0, 0x05E1, 0x05E2, + 0x05E3, 0x05E4, 0x05E5, 0x05E6, 0x05E7, 0x05E8, 0x05E9, 0x05EA, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 }; + + public Decoder8859_8(InputStream in) + { + super(in, "8859_8", lookup_table_8859_8); + } + +} // class Decoder8859_8 + diff --git a/gnu/java/io/decode/Decoder8859_9.java b/gnu/java/io/decode/Decoder8859_9.java new file mode 100644 index 000000000..c4397f0f8 --- /dev/null +++ b/gnu/java/io/decode/Decoder8859_9.java @@ -0,0 +1,100 @@ +/* Decoder8859_9.java -- Decoder for ISO-Latin-5 Character set. + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package gnu.java.io.decode; + +import java.io.InputStream; + +/** + * This class decodes bytes in ISO-8859-9 (Latin-5) format to Unicode. + * ibm-920_P100-1995 ibm-920 iso-8859-9 latin5 csISOLatin5 iso-ir-148 + * ISO_8859-9:1989 l5 8859_9 cp920 920 windows-28599 ECMA-128 + * + * @version 0.0 + * @author Quentin Anciaux (quentin.anciaux@advalvas.be) + * @author based on gnu.java.io.decode.Decoder8859_1 by Aaron M. Renn + * (arenn@urbanophile.com) + */ +public class Decoder8859_9 extends DecoderEightBitLookup +{ + + /** + * This is the lookup table for this encoding + */ + private static final char[] lookup_table_8859_9 = + { 0x0000, 0x0001, 0x0002, + 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000A, + 0x000B, 0x000C, 0x000D, 0x000E, 0x000F, 0x0010, 0x0011, 0x0012, + 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001A, + 0x001B, 0x001C, 0x001D, 0x001E, 0x001F, 0x0020, 0x0021, 0x0022, + 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002A, + 0x002B, 0x002C, 0x002D, 0x002E, 0x002F, 0x0030, 0x0031, 0x0032, + 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003A, + 0x003B, 0x003C, 0x003D, 0x003E, 0x003F, 0x0040, 0x0041, 0x0042, + 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004A, + 0x004B, 0x004C, 0x004D, 0x004E, 0x004F, 0x0050, 0x0051, 0x0052, + 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005A, + 0x005B, 0x005C, 0x005D, 0x005E, 0x005F, 0x0060, 0x0061, 0x0062, + 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006A, + 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, 0x0070, 0x0071, 0x0072, + 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007A, + 0x007B, 0x007C, 0x007D, 0x007E, 0x007F, 0x0080, 0x0081, 0x0082, + 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 0x0088, 0x0089, 0x008A, + 0x008B, 0x008C, 0x008D, 0x008E, 0x008F, 0x0090, 0x0091, 0x0092, + 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 0x0098, 0x0099, 0x009A, + 0x009B, 0x009C, 0x009D, 0x009E, 0x009F, 0x00A0, 0x00A1, 0x00A2, + 0x00A3, 0x00A4, 0x00A5, 0x00A6, 0x00A7, 0x00A8, 0x00A9, 0x00AA, + 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00AF, 0x00B0, 0x00B1, 0x00B2, + 0x00B3, 0x00B4, 0x00B5, 0x00B6, 0x00B7, 0x00B8, 0x00B9, 0x00BA, + 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0x00BF, 0x00C0, 0x00C1, 0x00C2, + 0x00C3, 0x00C4, 0x00C5, 0x00C6, 0x00C7, 0x00C8, 0x00C9, 0x00CA, + 0x00CB, 0x00CC, 0x00CD, 0x00CE, 0x00CF, 0x011E, 0x00D1, 0x00D2, + 0x00D3, 0x00D4, 0x00D5, 0x00D6, 0x00D7, 0x00D8, 0x00D9, 0x00DA, + 0x00DB, 0x00DC, 0x0130, 0x015E, 0x00DF, 0x00E0, 0x00E1, 0x00E2, + 0x00E3, 0x00E4, 0x00E5, 0x00E6, 0x00E7, 0x00E8, 0x00E9, 0x00EA, + 0x00EB, 0x00EC, 0x00ED, 0x00EE, 0x00EF, 0x011F, 0x00F1, 0x00F2, + 0x00F3, 0x00F4, 0x00F5, 0x00F6, 0x00F7, 0x00F8, 0x00F9, 0x00FA, + 0x00FB, 0x00FC, 0x0131, 0x015F, 0x00FF }; + + public Decoder8859_9(InputStream in) + { + super(in, "8859_9", lookup_table_8859_9); + } + +} // class Decoder8859_9 + diff --git a/gnu/java/io/decode/DecoderASCII.java b/gnu/java/io/decode/DecoderASCII.java new file mode 100644 index 000000000..ab236014d --- /dev/null +++ b/gnu/java/io/decode/DecoderASCII.java @@ -0,0 +1,324 @@ +/* DecoderASCII.java -- Decoder for ASCII Character set + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package gnu.java.io.decode; + +import java.io.InputStream; + +/** + * This class decodes bytes in ASCII format to Unicode. + * + * @version 0.0 + * + * @author Quentin Anciaux (quentin.anciaux@advalvas.be) + * @author based on gnu.java.io.decode.Decoder8859_1 by + * Aaron M. Renn (arenn@urbanophile.com) + */ +public class DecoderASCII extends DecoderEightBitLookup +{ + + /** + * This is the lookup table for this encoding + */ + + private static final char[] lookup_table_ASCII = { + 0x0000, + 0x0001, + 0x0002, + 0x0003, + 0x0004, + 0x0005, + 0x0006, + 0x0007, + 0x0008, + 0x0009, + 0x000A, + 0x000B, + 0x000C, + 0x000D, + 0x000E, + 0x000F, + 0x0010, + 0x0011, + 0x0012, + 0x0013, + 0x0014, + 0x0015, + 0x0016, + 0x0017, + 0x0018, + 0x0019, + 0x001A, + 0x001B, + 0x001C, + 0x001D, + 0x001E, + 0x001F, + 0x0020, + 0x0021, + 0x0022, + 0x0023, + 0x0024, + 0x0025, + 0x0026, + 0x0027, + 0x0028, + 0x0029, + 0x002A, + 0x002B, + 0x002C, + 0x002D, + 0x002E, + 0x002F, + 0x0030, + 0x0031, + 0x0032, + 0x0033, + 0x0034, + 0x0035, + 0x0036, + 0x0037, + 0x0038, + 0x0039, + 0x003A, + 0x003B, + 0x003C, + 0x003D, + 0x003E, + 0x003F, + 0x0040, + 0x0041, + 0x0042, + 0x0043, + 0x0044, + 0x0045, + 0x0046, + 0x0047, + 0x0048, + 0x0049, + 0x004A, + 0x004B, + 0x004C, + 0x004D, + 0x004E, + 0x004F, + 0x0050, + 0x0051, + 0x0052, + 0x0053, + 0x0054, + 0x0055, + 0x0056, + 0x0057, + 0x0058, + 0x0059, + 0x005A, + 0x005B, + 0x005C, + 0x005D, + 0x005E, + 0x005F, + 0x0060, + 0x0061, + 0x0062, + 0x0063, + 0x0064, + 0x0065, + 0x0066, + 0x0067, + 0x0068, + 0x0069, + 0x006A, + 0x006B, + 0x006C, + 0x006D, + 0x006E, + 0x006F, + 0x0070, + 0x0071, + 0x0072, + 0x0073, + 0x0074, + 0x0075, + 0x0076, + 0x0077, + 0x0078, + 0x0079, + 0x007A, + 0x007B, + 0x007C, + 0x007D, + 0x007E, + 0x007F, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000 + }; + + public DecoderASCII(InputStream in) + { + super(in, "ASCII", lookup_table_ASCII); + } + +} // class DecoderASCII + diff --git a/gnu/java/io/decode/DecoderCp1047.java b/gnu/java/io/decode/DecoderCp1047.java new file mode 100644 index 000000000..f8ac594e9 --- /dev/null +++ b/gnu/java/io/decode/DecoderCp1047.java @@ -0,0 +1,100 @@ +/* DecoderCp1047.java -- Decoder for EBCDIC Latin-1 Character set. + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package gnu.java.io.decode; + +import java.io.InputStream; + +/** + * This class decodes bytes in CP-1047 (EBCDIC Latin-1) format to Unicode. + * ibm-1047_P100-1995 ibm-1047 IBM1047 cpibm1047 cp1047 CP1047 cp-1047 CP-1047 + * ebcdic1047 EBCDIC1047 ebcdic-1047 EBCDIC-1047 + * + * @version 0.0 + * @author Quentin Anciaux (quentin.anciaux@advalvas.be) + * @author based on gnu.java.io.decode.Decoder8859_1 by Aaron M. Renn + * (arenn@urbanophile.com) + */ +public class DecoderCp1047 extends DecoderEightBitLookup +{ + + /** + * This is the lookup table for this encoding + */ + private static final char[] lookup_table_cp1047 = + { 0x0000, 0x0001, 0x0002, + 0x0003, 0x009C, 0x0009, 0x0086, 0x007F, 0x0097, 0x008D, 0x008E, + 0x000B, 0x000C, 0x000D, 0x000E, 0x000F, 0x0010, 0x0011, 0x0012, + 0x0013, 0x009D, 0x0085, 0x0008, 0x0087, 0x0018, 0x0019, 0x0092, + 0x008F, 0x001C, 0x001D, 0x001E, 0x001F, 0x0080, 0x0081, 0x0082, + 0x0083, 0x0084, 0x000A, 0x0017, 0x001B, 0x0088, 0x0089, 0x008A, + 0x008B, 0x008C, 0x0005, 0x0006, 0x0007, 0x0090, 0x0091, 0x0016, + 0x0093, 0x0094, 0x0095, 0x0096, 0x0004, 0x0098, 0x0099, 0x009A, + 0x009B, 0x0014, 0x0015, 0x009E, 0x001A, 0x0020, 0x00A0, 0x00E2, + 0x00E4, 0x00E0, 0x00E1, 0x00E3, 0x00E5, 0x00E7, 0x00F1, 0x00A2, + 0x002E, 0x003C, 0x0028, 0x002B, 0x007C, 0x0026, 0x00E9, 0x00EA, + 0x00EB, 0x00E8, 0x00ED, 0x00EE, 0x00EF, 0x00EC, 0x00DF, 0x0021, + 0x0024, 0x002A, 0x0029, 0x003B, 0x005E, 0x002D, 0x002F, 0x00C2, + 0x00C4, 0x00C0, 0x00C1, 0x00C3, 0x00C5, 0x00C7, 0x00D1, 0x00A6, + 0x002C, 0x0025, 0x005F, 0x003E, 0x003F, 0x00F8, 0x00C9, 0x00CA, + 0x00CB, 0x00C8, 0x00CD, 0x00CE, 0x00CF, 0x00CC, 0x0060, 0x003A, + 0x0023, 0x0040, 0x0027, 0x003D, 0x0022, 0x00D8, 0x0061, 0x0062, + 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x00AB, + 0x00BB, 0x00F0, 0x00FD, 0x00FE, 0x00B1, 0x00B0, 0x006A, 0x006B, + 0x006C, 0x006D, 0x006E, 0x006F, 0x0070, 0x0071, 0x0072, 0x00AA, + 0x00BA, 0x00E6, 0x00B8, 0x00C6, 0x00A4, 0x00B5, 0x007E, 0x0073, + 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007A, 0x00A1, + 0x00BF, 0x00D0, 0x005B, 0x00DE, 0x00AE, 0x00AC, 0x00A3, 0x00A5, + 0x00B7, 0x00A9, 0x00A7, 0x00B6, 0x00BC, 0x00BD, 0x00BE, 0x00DD, + 0x00A8, 0x00AF, 0x005D, 0x00B4, 0x00D7, 0x007B, 0x0041, 0x0042, + 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x00AD, + 0x00F4, 0x00F6, 0x00F2, 0x00F3, 0x00F5, 0x007D, 0x004A, 0x004B, + 0x004C, 0x004D, 0x004E, 0x004F, 0x0050, 0x0051, 0x0052, 0x00B9, + 0x00FB, 0x00FC, 0x00F9, 0x00FA, 0x00FF, 0x005C, 0x00F7, 0x0053, + 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005A, 0x00B2, + 0x00D4, 0x00D6, 0x00D2, 0x00D3, 0x00D5, 0x0030, 0x0031, 0x0032, + 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x00B3, + 0x00DB, 0x00DC, 0x00D9, 0x00DA, 0x009F }; + + public DecoderCp1047(InputStream in) + { + super(in, "cp1047", lookup_table_cp1047); + } + +} // class DecoderCp1047 + diff --git a/gnu/java/io/decode/DecoderEBCDIC_XML_US.java b/gnu/java/io/decode/DecoderEBCDIC_XML_US.java new file mode 100644 index 000000000..a5a4d2aa1 --- /dev/null +++ b/gnu/java/io/decode/DecoderEBCDIC_XML_US.java @@ -0,0 +1,99 @@ +/* DecoderEBCDIC_XML_US.java -- Decoder for EBCDIC_XML_US Character set. + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package gnu.java.io.decode; + +import java.io.InputStream; + +/** + * This class decodes bytes in EBCDIC_XML_US format to Unicode. ebcdic-xml-us + * ebcdic EBCDIC EBCDIC-XML-US EBCDIC_XML_US ebcdic_xml_us + * + * @version 0.0 + * @author Quentin Anciaux (quentin.anciaux@advalvas.be) + * @author based on gnu.java.io.decode.Decoder8859_1 by Aaron M. Renn + * (arenn@urbanophile.com) + */ +public class DecoderEBCDIC_XML_US extends DecoderEightBitLookup +{ + + /** + * This is the lookup table for this encoding + */ + private static final char[] lookup_table_ebcdic_xml_us = + { 0x0000, 0x0001, + 0x0002, 0x0003, 0x009C, 0x0009, 0x0086, 0x007F, 0x0097, 0x008D, + 0x008E, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F, 0x0010, 0x0011, + 0x0012, 0x0013, 0x009D, 0x000A, 0x0008, 0x0087, 0x0018, 0x0019, + 0x0092, 0x008F, 0x001C, 0x001D, 0x001E, 0x001F, 0x0080, 0x0081, + 0x0082, 0x0083, 0x0084, 0x000A, 0x0017, 0x001B, 0x0088, 0x0089, + 0x008A, 0x008B, 0x008C, 0x0005, 0x0006, 0x0007, 0x0090, 0x0091, + 0x0016, 0x0093, 0x0094, 0x0095, 0x0096, 0x0004, 0x0098, 0x0099, + 0x009A, 0x009B, 0x0014, 0x0015, 0x009E, 0x001A, 0x0020, 0x00A0, + 0x00E2, 0x00E4, 0x00E0, 0x00E1, 0x00E3, 0x00E5, 0x00E7, 0x00F1, + 0x00A2, 0x002E, 0x003C, 0x0028, 0x002B, 0x007C, 0x0026, 0x00E9, + 0x00EA, 0x00EB, 0x00E8, 0x00ED, 0x00EE, 0x00EF, 0x00EC, 0x00DF, + 0x0021, 0x0024, 0x002A, 0x0029, 0x003B, 0x00AC, 0x002D, 0x002F, + 0x00C2, 0x00C4, 0x00C0, 0x00C1, 0x00C3, 0x00C5, 0x00C7, 0x00D1, + 0x00A6, 0x002C, 0x0025, 0x005F, 0x003E, 0x003F, 0x00F8, 0x00C9, + 0x00CA, 0x00CB, 0x00C8, 0x00CD, 0x00CE, 0x00CF, 0x00CC, 0x0060, + 0x003A, 0x0023, 0x0040, 0x0027, 0x003D, 0x0022, 0x00D8, 0x0061, + 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, + 0x00AB, 0x00BB, 0x00F0, 0x00FD, 0x00FE, 0x00B1, 0x00B0, 0x006A, + 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, 0x0070, 0x0071, 0x0072, + 0x00AA, 0x00BA, 0x00E6, 0x00B8, 0x00C6, 0x20AC, 0x00B5, 0x007E, + 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007A, + 0x00A1, 0x00BF, 0x00D0, 0x00DD, 0x00DE, 0x00AE, 0x005E, 0x00A3, + 0x00A5, 0x00B7, 0x00A9, 0x00A7, 0x00B6, 0x00BC, 0x00BD, 0x00BE, + 0x005B, 0x005D, 0x00AF, 0x00A8, 0x00B4, 0x00D7, 0x007B, 0x0041, + 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, + 0x00AD, 0x00F4, 0x00F6, 0x00F2, 0x00F3, 0x00F5, 0x007D, 0x004A, + 0x004B, 0x004C, 0x004D, 0x004E, 0x004F, 0x0050, 0x0051, 0x0052, + 0x00B9, 0x00FB, 0x00FC, 0x00F9, 0x00FA, 0x00FF, 0x005C, 0x00F7, + 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005A, + 0x00B2, 0x00D4, 0x00D6, 0x00D2, 0x00D3, 0x00D5, 0x0030, 0x0031, + 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, + 0x00B3, 0x00DB, 0x00DC, 0x00D9, 0x00DA, 0x009F }; + + public DecoderEBCDIC_XML_US(InputStream in) + { + super(in, "ebcdic-xml-us", lookup_table_ebcdic_xml_us); + } + +} // class DecoderEBCDIC_XML_US + diff --git a/gnu/java/io/decode/DecoderUTF16BE.java b/gnu/java/io/decode/DecoderUTF16BE.java new file mode 100644 index 000000000..85c892bde --- /dev/null +++ b/gnu/java/io/decode/DecoderUTF16BE.java @@ -0,0 +1,284 @@ +/* DecoderUTF16BE.java -- Decoder for the UTF-16 Big Endian character encoding. + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package gnu.java.io.decode; + +import java.io.IOException; +import java.io.InputStream; +import java.math.BigInteger; + +/** + * This class implements character decoding in the UCS Transformation Format 16 + * Big Endian (UTF-16BE) encoding scheme. + * + * @version 0.0 + * @author Quentin Anciaux (quentin.anciaux@advalvas.be) + */ +public class DecoderUTF16BE extends Decoder +{ + + // If we're operating in stream mode and we encounter a surrogate pair that + // we can't fit in the output buffer, we use this field to store the + // second half of the surrogate pair. + private int pendingChar = -1; + + public DecoderUTF16BE(InputStream in) + { + super(in, "UTF-16BE"); + } + + /** + * Counts the number of characters in a given byte array + */ + public int charsInByteArray(byte[] buf, int offset, int len) + { + int num_chars = 0; + // Scan the buffer with minimal validation checks + for (int i = offset; i < offset + len; ) + { + if (i + 1 < buf.length) + { + int word = new BigInteger(new byte[] + { buf[i], buf[i + 1] }).intValue(); + + if (word == 0xFEFF) + { + i += 2; + if (i >= buf.length) + break; + } + else if (word >= 0xD800 && word <= 0xDBFF) + { + if ((i + 3) >= buf.length) + break; + int wordtrail = new BigInteger(new byte[] + { buf[i + 2], buf[i + 3] }).intValue(); + + if (wordtrail >= 0xDC00 && wordtrail <= 0xDFFF) + { + ++num_chars; + ++num_chars; + i += 4; + if (i >= buf.length) + break; + } + else + { + i += 2; + if (i >= buf.length) + break; + } + } + else if (word >= 0xDC00 && word <= 0xDFFF) + { + i += 2; + if (i >= buf.length) + break; + } + else + { + ++num_chars; + i += 2; + if (i >= buf.length) + break; + } + } + else + break; + } + + return num_chars; + } + + /** + * Transform the specified UTF16BE encoded buffer to Unicode characters + */ + public char[] convertToChars(byte[] buf, int buf_offset, int len, + char cbuf[], int cbuf_offset) + { + int val; + // Scan the buffer with full validation checks + for (int i = buf_offset; i < buf_offset + len; ) + { + if (i + 1 < buf.length) + { + int word = new BigInteger(new byte[] + { buf[i], buf[i + 1] }).intValue(); + + if (word == 0xFEFF) + { + // BOM ??, IGNORE + i += 2; + if (i >= buf.length) + break; + } + else if (word >= 0xD800 && word <= 0xDBFF) + { + if ((i + 3) >= buf.length) + break; + int wordtrail = new BigInteger(new byte[] + { buf[i + 2], buf[i + 3] }).intValue(); + + if (wordtrail >= 0xDC00 && wordtrail <= 0xDFFF) + { + cbuf[cbuf_offset++] = (char) word; + cbuf[cbuf_offset++] = (char) wordtrail; + i += 4; + if (i >= buf.length) + break; + } + else + { + // ELSE NOT LEGAL SURROGATE POSITION, IGNORE + i += 2; + if (i >= buf.length) + break; + } + } + else if (word >= 0xDC00 && word <= 0xDFFF) + { + // NOT LEGAL SURROGATE POSITION, IGNORE + i += 2; + if (i >= buf.length) + break; + } + else + { + cbuf[cbuf_offset++] = (char) word; + i += 2; + if (i >= buf.length) + break; + } + } + else + { + // UNEXPECTED END, IGNORE + break; + } + } + + return cbuf; + } + + /** + * Reads chars from a UTF16BE encoded byte stream + */ + public int read(char[] cbuf, int offset, int len) throws IOException + { + if (pendingChar != -1 && len > 0) + { + cbuf[offset++] = (char) pendingChar; + pendingChar = -1; + } + + byte[] buffer = new byte[4]; + for (int i = offset; i < offset + len; ) + { + // Read a byte + int b = in.read(); + if (b == -1) + if (i == offset) + return -1; + else + return i - offset; + buffer[0] = (byte) b; + b = in.read(); + if (b == -1) + break; + buffer[1] = (byte) b; + int word = new BigInteger(new byte[] + { buffer[0], buffer[1] }).intValue(); + + if (word == 0xFEFF) + { + if (in.available() <= 0) + return 1 + i - offset; + continue; + } + else if (word >= 0xD800 && word <= 0xDBFF) + { + b = in.read(); + if (b == -1) + break; + buffer[2] = (byte) b; + b = in.read(); + if (b == -1) + break; + buffer[3] = (byte) b; + int wordtrail = new BigInteger(new byte[] + { buffer[2], buffer[3] }).intValue(); + + if (wordtrail >= 0xDC00 && wordtrail <= 0xDFFF) + { + cbuf[i++] = (char) word; + if (i < offset + len) + cbuf[i] = (char) wordtrail; + else + pendingChar = (char) wordtrail; + } + else + { + cbuf[i] = (char) wordtrail; + if (in.available() <= 0) + return (1 + i - offset); + continue; + } + } + else if (word >= 0xDC00 && word <= 0xDFFF) + { + if (in.available() <= 0) + return (1 + i - offset); + continue; + } + else + cbuf[i] = (char) word; + + // if no more bytes available, terminate loop early, instead of + // blocking in in.read(). + // Do not test this in the for condition: it must call in.read() at + // least once (and thus block if "in" is empty). + if (in.available() <= 0) + return (1 + i - offset); + i++; + } + + return len; + } + +} // class DecoderUTF16BE + diff --git a/gnu/java/io/decode/DecoderUTF16LE.java b/gnu/java/io/decode/DecoderUTF16LE.java new file mode 100644 index 000000000..d9b4d98c3 --- /dev/null +++ b/gnu/java/io/decode/DecoderUTF16LE.java @@ -0,0 +1,279 @@ +/* DecoderUTF16LE.java -- Decoder for the UTF-16 Little Endian character set. + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package gnu.java.io.decode; + +import java.io.IOException; +import java.io.InputStream; +import java.math.BigInteger; + +/** + * This class implements character decoding in the UCS Transformation Format 16 + * Little Endian (UTF-16LE) encoding scheme. + * + * @version 0.0 + * @author Quentin Anciaux (quentin.anciaux@advalvas.be) + */ +public class DecoderUTF16LE extends Decoder +{ + + // If we're operating in stream mode and we encounter a surrogate pair that + // we can't fit in the output buffer, we use this field to store the + // second half of the surrogate pair. + private int pendingChar = -1; + + public DecoderUTF16LE(InputStream in) + { + super(in, "UTF-16LE"); + } + + /** + * Counts the number of characters in a given byte array + */ + public int charsInByteArray(byte[] buf, int offset, int len) + { + int num_chars = 0; + // Scan the buffer with minimal validation checks + for (int i = offset; i < offset + len; ) + { + if (i + 1 < buf.length) + { + int word = new BigInteger(new byte[] + { buf[i + 1], buf[i] }).intValue(); + + if (word == 0xFEFF) + { + i += 2; + if (i >= buf.length) + break; + } + else if (word >= 0xD800 && word <= 0xDBFF) + { + if ((i + 3) >= buf.length) + break; + int wordtrail = new BigInteger(new byte[] + { buf[i + 3], buf[i + 2] }).intValue(); + + if (wordtrail >= 0xDC00 && wordtrail <= 0xDFFF) + { + ++num_chars; + i += 4; + if (i >= buf.length) + break; + } + else + { + i += 2; + if (i >= buf.length) + break; + } + } + else if (word >= 0xDC00 && word <= 0xDFFF) + { + i += 2; + if (i >= buf.length) + break; + } + else + { + ++num_chars; + i += 2; + if (i >= buf.length) + break; + } + } + else + break; + } + + return num_chars; + } + + /** + * Transform the specified UTF16LE encoded buffer to Unicode characters + */ + public char[] convertToChars(byte[] buf, int buf_offset, int len, + char cbuf[], int cbuf_offset) + { + int val; + // Scan the buffer with full validation checks + for (int i = buf_offset; i < buf_offset + len; ) + { + if (i + 1 < buf.length) + { + int word = new BigInteger(new byte[] + { buf[i + 1], buf[i] }).intValue(); + + if (word == 0xFEFF) + { + // BOM ??, IGNORE + i += 2; + if (i >= buf.length) + break; + } + else if (word >= 0xD800 && word <= 0xDBFF) + { + if ((i + 3) >= buf.length) + break; + int wordtrail = new BigInteger(new byte[] + { buf[i + 3], buf[i + 2] }).intValue(); + + if (wordtrail >= 0xDC00 && wordtrail <= 0xDFFF) + { + cbuf[cbuf_offset++] = (char) word; + cbuf[cbuf_offset++] = (char) wordtrail; + i += 4; + if (i >= buf.length) + break; + } + else + { + // ELSE NOT LEGAL SURROGATE POSITION, IGNORE + i += 2; + if (i >= buf.length) + break; + } + } + else if (word >= 0xDC00 && word <= 0xDFFF) + { + // NOT LEGAL SURROGATE POSITION, IGNORE + i += 2; + if (i >= buf.length) + break; + } + else + { + cbuf[cbuf_offset++] = (char) word; + i += 2; + if (i >= buf.length) + break; + } + } + else + { + // UNEXPECTED END, IGNORE + break; + } + } + + return cbuf; + } + + /** ********************************************************************** */ + + /** + * Reads chars from a UTF16LE encoded byte stream + */ + public int read(char[] cbuf, int offset, int len) throws IOException + { + byte[] buffer = new byte[4]; + for (int i = offset; i < offset + len; ) + { + // Read a byte + int b = in.read(); + if (b == -1) + if (i == offset) + return -1; + else + return i - offset; + buffer[0] = (byte) b; + b = in.read(); + if (b == -1) + break; + buffer[1] = (byte) b; + int word = new BigInteger(new byte[] + { buffer[1], buffer[0] }).intValue(); + + if (word == 0xFEFF) + { + if (in.available() <= 0) + return (1 + i - offset); + continue; + } + else if (word >= 0xD800 && word <= 0xDBFF) + { + b = in.read(); + if (b == -1) + break; + buffer[2] = (byte) b; + b = in.read(); + if (b == -1) + break; + buffer[3] = (byte) b; + int wordtrail = new BigInteger(new byte[] + { buffer[3], buffer[2] }).intValue(); + + if (wordtrail >= 0xDC00 && wordtrail <= 0xDFFF) + { + cbuf[i++] = (char) word; + if (i < offset + len) + cbuf[i] = (char) wordtrail; + else + pendingChar = (char) wordtrail; + } + else + { + cbuf[i] = (char) wordtrail; + if (in.available() <= 0) + return (1 + i - offset); + continue; + } + } + else if (word >= 0xDC00 && word <= 0xDFFF) + { + if (in.available() <= 0) + return (1 + i - offset); + continue; + } + else + cbuf[i] = (char) word; + + // if no more bytes available, terminate loop early, instead of + // blocking in in.read(). + // Do not test this in the for condition: it must call in.read() at + // least once (and thus block if "in" is empty). + if (in.available() <= 0) + return 1 + i - offset; + + i++; + } + + return len; + } + +} // class DecoderUTF16LE diff --git a/gnu/java/io/decode/DecoderUTF32BE.java b/gnu/java/io/decode/DecoderUTF32BE.java new file mode 100644 index 000000000..10b353b0c --- /dev/null +++ b/gnu/java/io/decode/DecoderUTF32BE.java @@ -0,0 +1,222 @@ +/* DecoderUTF32BE.java -- Decoder for the UTF-32 Big Endian character encoding. + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package gnu.java.io.decode; + +import java.io.IOException; +import java.io.InputStream; +import java.math.BigInteger; + +/** + * This class implements character decoding in the UCS Transformation Format 32 + * Big Endian (UTF-32BE) encoding scheme. + * + * @version 0.0 + * @author Quentin Anciaux (quentin.anciaux@advalvas.be) + */ +public class DecoderUTF32BE extends Decoder +{ + // If we're operating in stream mode and we encounter a surrogate pair that + // we can't fit in the output buffer, we use this field to store the + // second half of the surrogate pair. + private int pendingChar = -1; + + public DecoderUTF32BE(InputStream in) + { + super(in, "UTF-32BE"); + } + + /** + * Counts the number of characters in a given byte array + */ + public int charsInByteArray(byte[] buf, int offset, int len) + { + int num_chars = 0; + // Scan the buffer with minimal validation checks + for (int i = offset; i < offset + len; ) + { + if (i + 3 < buf.length) + { + long dword = new BigInteger(new byte[] + { buf[i], buf[i + 1], buf[i + 2], buf[i + 3] }).longValue(); + + if (dword == 0xFEFF) + { + i += 4; + if (i >= buf.length) + break; + } + else if (dword >= 0x10000) + { + ++num_chars; + ++num_chars; + i += 4; + if (i >= buf.length) + break; + } + else + { + ++num_chars; + i += 4; + if (i >= buf.length) + break; + } + } + else + break; + } + + return num_chars; + } + + /** + * Transform the specified UTF32BE encoded buffer to Unicode characters + */ + public char[] convertToChars(byte[] buf, int buf_offset, int len, + char cbuf[], int cbuf_offset) + { + int val; + // Scan the buffer with full validation checks + for (int i = buf_offset; i < buf_offset + len; ) + { + if (i + 3 < buf.length) + { + long dword = new BigInteger(new byte[] + { buf[i], buf[i + 1], buf[i + 2], buf[i + 3] }).longValue(); + + if (dword == 0xFEFF) + { + i += 4; + if (i >= buf.length) + break; + } + else if (dword >= 0x10000) + { + dword -= 0x10000; + cbuf[cbuf_offset++] = (char) (0xD800 + (dword >> 10)); + cbuf[cbuf_offset++] = (char) (0xDC00 + (dword & 0x3FF)); + i += 4; + if (i >= buf.length) + break; + } + else + { + cbuf[cbuf_offset++] = (char) dword; + i += 4; + if (i >= buf.length) + break; + } + } + else + break; + } + + return cbuf; + } + + /** + * Reads chars from a UTF32BE encoded byte stream + */ + public int read(char[] cbuf, int offset, int len) throws IOException + { + if (pendingChar != -1 && len > 0) + { + cbuf[offset++] = (char) pendingChar; + pendingChar = -1; + } + + byte[] buffer = new byte[4]; + for (int i = offset; i < offset + len; ) + { + // Read a byte + int b = in.read(); + if (b == -1) + if (i == offset) + return (-1); + else + return (i - offset); + buffer[0] = (byte) b; + b = in.read(); + if (b == -1) + break; + buffer[1] = (byte) b; + b = in.read(); + if (b == -1) + break; + buffer[2] = (byte) b; + b = in.read(); + if (b == -1) + break; + buffer[3] = (byte) b; + + long dword = new BigInteger(new byte[] + { buffer[0], buffer[1], buffer[2], buffer[3] }).longValue(); + + if (dword == 0xFEFF) + { + if (in.available() <= 0) + return (1 + i - offset); + continue; + } + else if (dword >= 0x10000) + { + dword -= 0x10000; + cbuf[i++] = (char) (0xD800 + (dword >> 10)); + if (i < offset + len) + cbuf[i] = (char) (0xDC00 + (dword & 0x3FF)); + else + pendingChar = (char) (0xDC00 + (dword & 0x3FF)); + } + else + cbuf[i] = (char) dword; + + // if no more bytes available, terminate loop early, instead of + // blocking in in.read(). + // Do not test this in the for condition: it must call in.read() at + // least once (and thus block if "in" is empty). + if (in.available() <= 0) + return (1 + i - offset); + + i++; + } + + return len; + } + +} // class DecoderUTF32BE + diff --git a/gnu/java/io/decode/DecoderUTF32LE.java b/gnu/java/io/decode/DecoderUTF32LE.java new file mode 100644 index 000000000..538283c94 --- /dev/null +++ b/gnu/java/io/decode/DecoderUTF32LE.java @@ -0,0 +1,224 @@ +/* DecoderUTF32LE.java -- Decoder for the UTF-32 Little Endian character set. + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package gnu.java.io.decode; + +import java.io.IOException; +import java.io.InputStream; +import java.math.BigInteger; + +/** + * This class implements character decoding in the UCS Transformation Format 32 + * Big Endian (UTF-32LE) encoding scheme. + * + * @version 0.0 + * @author Quentin Anciaux (quentin.anciaux@advalvas.be) + */ +public class DecoderUTF32LE extends Decoder +{ + + // If we're operating in stream mode and we encounter a surrogate pair that + // we can't fit in the output buffer, we use this field to store the + // second half of the surrogate pair. + private int pendingChar = -1; + + public DecoderUTF32LE(InputStream in) + { + super(in, "UTF-32LE"); + } + + /** + * Counts the number of characters in a given byte array + */ + public int charsInByteArray(byte[] buf, int offset, int len) + { + int num_chars = 0; + // Scan the buffer with minimal validation checks + for (int i = offset; i < offset + len; ) + { + if (i + 3 < buf.length) + { + long dword = new BigInteger(new byte[] + { buf[i + 3], buf[i + 2], buf[i + 1], buf[i] }).longValue(); + + if (dword == 0xFEFF) + { + i += 4; + if (i >= buf.length) + break; + } + else if (dword >= 0x10000) + { + ++num_chars; + ++num_chars; + i += 4; + if (i >= buf.length) + break; + } + else + { + ++num_chars; + i += 4; + if (i >= buf.length) + break; + } + } + else + break; + } + + return num_chars; + } + + /** + * Transform the specified UTF32LE encoded buffer to Unicode characters + */ + public char[] convertToChars(byte[] buf, int buf_offset, int len, + char cbuf[], int cbuf_offset) + { + int val; + // Scan the buffer with full validation checks + for (int i = buf_offset; i < buf_offset + len; ) + { + if (i + 3 < buf.length) + { + long dword = new BigInteger(new byte[] + { buf[i + 3], buf[i + 2], buf[i + 1], buf[i] }).longValue(); + + if (dword == 0xFEFF) + { + i += 4; + if (i >= buf.length) + break; + } + else if (dword >= 0x10000) + { + dword -= 0x10000; + cbuf[cbuf_offset++] = (char) (0xD800 + (dword >> 10)); + cbuf[cbuf_offset++] = (char) (0xDC00 + (dword & 0x3FF)); + i += 4; + if (i >= buf.length) + break; + } + else + { + cbuf[cbuf_offset++] = (char) dword; + i += 4; + if (i >= buf.length) + break; + } + } + else + break; + } + + return cbuf; + } + + /** + * Reads chars from a UTF32LE encoded byte stream + */ + public int read(char[] cbuf, int offset, int len) throws IOException + { + if (pendingChar != -1 && len > 0) + { + cbuf[offset++] = (char) pendingChar; + pendingChar = -1; + } + + byte[] buffer = new byte[4]; + for (int i = offset; i < offset + len; ) + { + // Read a byte + int b = in.read(); + if (b == -1) + if (i == offset) + return -1; + else + return i - offset; + + buffer[0] = (byte) b; + b = in.read(); + if (b == -1) + break; + buffer[1] = (byte) b; + b = in.read(); + if (b == -1) + break; + buffer[2] = (byte) b; + b = in.read(); + if (b == -1) + break; + buffer[3] = (byte) b; + + long dword = new BigInteger(new byte[] + { buffer[3], buffer[2], buffer[1], buffer[0] }).longValue(); + + if (dword == 0xFEFF) + { + if (in.available() <= 0) + return (1 + i - offset); + continue; + } + else if (dword >= 0x10000) + { + dword -= 0x10000; + cbuf[i++] = (char) (0xD800 + (dword >> 10)); + if (i < offset + len) + cbuf[i] = (char) (0xDC00 + (dword & 0x3FF)); + else + pendingChar = (char) (0xDC00 + (dword & 0x3FF)); + } + else + cbuf[i] = (char) dword; + + // if no more bytes available, terminate loop early, instead of + // blocking in in.read(). + // Do not test this in the for condition: it must call in.read() at + // least once (and thus block if "in" is empty). + if (in.available() <= 0) + return (1 + i - offset); + + i++; + } + + return len; + } + +} // class DecoderUTF32LE + diff --git a/gnu/java/io/decode/DecoderWindows1250.java b/gnu/java/io/decode/DecoderWindows1250.java new file mode 100644 index 000000000..c2c3a35d7 --- /dev/null +++ b/gnu/java/io/decode/DecoderWindows1250.java @@ -0,0 +1,100 @@ +/* DecoderWindows1250.java -- Decoder for Windows-1250 Character set. + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package gnu.java.io.decode; + +import java.io.InputStream; + +/** + * This class decodes bytes in Windows-1250 format to Unicode. + * ibm-5346_P100-1998 ibm-5346 windows-1250 Windows-1250 cp1250 CP1250 cp-1250 + * CP-1250 Windows1250 windows1250 + * + * @version 0.0 + * @author Quentin Anciaux (quentin.anciaux@advalvas.be) + * @author based on gnu.java.io.decode.Decoder8859_1 by Aaron M. Renn + * (arenn@urbanophile.com) + */ +public class DecoderWindows1250 extends DecoderEightBitLookup +{ + + /** + * This is the lookup table for this encoding + */ + private static final char[] lookup_table_windows_1250 = + { 0x0000, 0x0001, + 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, + 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F, 0x0010, 0x0011, + 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, + 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F, 0x0020, 0x0021, + 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, + 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F, 0x0030, 0x0031, + 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, + 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F, 0x0040, 0x0041, + 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, + 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F, 0x0050, 0x0051, + 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, + 0x005A, 0x005B, 0x005C, 0x005D, 0x005E, 0x005F, 0x0060, 0x0061, + 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, + 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, 0x0070, 0x0071, + 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, + 0x007A, 0x007B, 0x007C, 0x007D, 0x007E, 0x007F, 0x20AC, 0x0081, + 0x201A, 0x0083, 0x201E, 0x2026, 0x2020, 0x2021, 0x0088, 0x2030, + 0x0160, 0x2039, 0x015A, 0x0164, 0x017D, 0x0179, 0x0090, 0x2018, + 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014, 0x0098, 0x2122, + 0x0161, 0x203A, 0x015B, 0x0165, 0x017E, 0x017A, 0x00A0, 0x02C7, + 0x02D8, 0x0141, 0x00A4, 0x0104, 0x00A6, 0x00A7, 0x00A8, 0x00A9, + 0x015E, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x017B, 0x00B0, 0x00B1, + 0x02DB, 0x0142, 0x00B4, 0x00B5, 0x00B6, 0x00B7, 0x00B8, 0x0105, + 0x015F, 0x00BB, 0x013D, 0x02DD, 0x013E, 0x017C, 0x0154, 0x00C1, + 0x00C2, 0x0102, 0x00C4, 0x0139, 0x0106, 0x00C7, 0x010C, 0x00C9, + 0x0118, 0x00CB, 0x011A, 0x00CD, 0x00CE, 0x010E, 0x0110, 0x0143, + 0x0147, 0x00D3, 0x00D4, 0x0150, 0x00D6, 0x00D7, 0x0158, 0x016E, + 0x00DA, 0x0170, 0x00DC, 0x00DD, 0x0162, 0x00DF, 0x0155, 0x00E1, + 0x00E2, 0x0103, 0x00E4, 0x013A, 0x0107, 0x00E7, 0x010D, 0x00E9, + 0x0119, 0x00EB, 0x011B, 0x00ED, 0x00EE, 0x010F, 0x0111, 0x0144, + 0x0148, 0x00F3, 0x00F4, 0x0151, 0x00F6, 0x00F7, 0x0159, 0x016F, + 0x00FA, 0x0171, 0x00FC, 0x00FD, 0x0163, 0x02D9 }; + + public DecoderWindows1250(InputStream in) + { + super(in, "Windows-1250", lookup_table_windows_1250); + } + +} // class DecoderWindows1250 + diff --git a/gnu/java/io/decode/DecoderWindows1252.java b/gnu/java/io/decode/DecoderWindows1252.java new file mode 100644 index 000000000..4e9d476e4 --- /dev/null +++ b/gnu/java/io/decode/DecoderWindows1252.java @@ -0,0 +1,100 @@ +/* DecoderWindows1252.java -- Decoder for Windows-1252 Character set. + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package gnu.java.io.decode; + +import java.io.InputStream; + +/** + * This class decodes bytes in Windows-1252 format to Unicode. + * ibm-5348_P100-1997 ibm-5348 windows-1252 Windows-1252 cp1252 CP1252 cp-1252 + * CP-1252 Windows1252 windows1252 + * + * @version 0.0 + * @author Quentin Anciaux (quentin.anciaux@advalvas.be) + * @author based on gnu.java.io.decode.Decoder8859_1 by Aaron M. Renn + * (arenn@urbanophile.com) + */ +public class DecoderWindows1252 extends DecoderEightBitLookup +{ + + /** + * This is the lookup table for this encoding + */ + private static final char[] lookup_table_windows_1252 = + { 0x0000, 0x0001, + 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, + 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F, 0x0010, 0x0011, + 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, + 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F, 0x0020, 0x0021, + 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, + 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F, 0x0030, 0x0031, + 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, + 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F, 0x0040, 0x0041, + 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, + 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F, 0x0050, 0x0051, + 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, + 0x005A, 0x005B, 0x005C, 0x005D, 0x005E, 0x005F, 0x0060, 0x0061, + 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, + 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, 0x0070, 0x0071, + 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, + 0x007A, 0x007B, 0x007C, 0x007D, 0x007E, 0x007F, 0x20AC, 0x0081, + 0x201A, 0x0192, 0x201E, 0x2026, 0x2020, 0x2021, 0x02C6, 0x2030, + 0x0160, 0x2039, 0x0152, 0x008D, 0x017D, 0x008F, 0x0090, 0x2018, + 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014, 0x02DC, 0x2122, + 0x0161, 0x203A, 0x0153, 0x009D, 0x017E, 0x0178, 0x00A0, 0x00A1, + 0x00A2, 0x00A3, 0x00A4, 0x00A5, 0x00A6, 0x00A7, 0x00A8, 0x00A9, + 0x00AA, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00AF, 0x00B0, 0x00B1, + 0x00B2, 0x00B3, 0x00B4, 0x00B5, 0x00B6, 0x00B7, 0x00B8, 0x00B9, + 0x00BA, 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0x00BF, 0x00C0, 0x00C1, + 0x00C2, 0x00C3, 0x00C4, 0x00C5, 0x00C6, 0x00C7, 0x00C8, 0x00C9, + 0x00CA, 0x00CB, 0x00CC, 0x00CD, 0x00CE, 0x00CF, 0x00D0, 0x00D1, + 0x00D2, 0x00D3, 0x00D4, 0x00D5, 0x00D6, 0x00D7, 0x00D8, 0x00D9, + 0x00DA, 0x00DB, 0x00DC, 0x00DD, 0x00DE, 0x00DF, 0x00E0, 0x00E1, + 0x00E2, 0x00E3, 0x00E4, 0x00E5, 0x00E6, 0x00E7, 0x00E8, 0x00E9, + 0x00EA, 0x00EB, 0x00EC, 0x00ED, 0x00EE, 0x00EF, 0x00F0, 0x00F1, + 0x00F2, 0x00F3, 0x00F4, 0x00F5, 0x00F6, 0x00F7, 0x00F8, 0x00F9, + 0x00FA, 0x00FB, 0x00FC, 0x00FD, 0x00FE, 0x00FF }; + + public DecoderWindows1252(InputStream in) + { + super(in, "Windows-1252", lookup_table_windows_1252); + } + +} // class DecoderWindows1252 + diff --git a/gnu/java/io/encode/Encoder8859_13.java b/gnu/java/io/encode/Encoder8859_13.java new file mode 100644 index 000000000..1408f1876 --- /dev/null +++ b/gnu/java/io/encode/Encoder8859_13.java @@ -0,0 +1,100 @@ +/* Encoder8859_13.java -- Encoder for ISO-8859-13 Character set. + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package gnu.java.io.encode; + +import java.io.OutputStream; + +/** + * This class encodes bytes in ISO-8859-13 format to Unicode. 8859_13 + * ibm-921_P100-1995 ibm-921 ISO_8859_13 iso_8859_13 ISO8859_13 iso8859_13 + * ISO-8859-13 iso-8859-13 8859_13 cp921 921 + * + * @version 0.0 + * @author Quentin Anciaux (quentin.anciaux@advalvas.be) + * @author based on gnu.java.io.encode.Encoder8859_1 by Aaron M. Renn + * (arenn@urbanophile.com) + */ +public class Encoder8859_13 extends EncoderEightBitLookup +{ + + /** + * This is the lookup table for this encoding + */ + private static final char[] lookup_table_8859_13 = + { 0x0000, 0x0001, + 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, + 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F, 0x0010, 0x0011, + 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, + 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F, 0x0020, 0x0021, + 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, + 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F, 0x0030, 0x0031, + 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, + 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F, 0x0040, 0x0041, + 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, + 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F, 0x0050, 0x0051, + 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, + 0x005A, 0x005B, 0x005C, 0x005D, 0x005E, 0x005F, 0x0060, 0x0061, + 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, + 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, 0x0070, 0x0071, + 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, + 0x007A, 0x007B, 0x007C, 0x007D, 0x007E, 0x007F, 0x0080, 0x0081, + 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 0x0088, 0x0089, + 0x008A, 0x008B, 0x008C, 0x008D, 0x008E, 0x008F, 0x0090, 0x0091, + 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 0x0098, 0x0099, + 0x009A, 0x009B, 0x009C, 0x009D, 0x009E, 0x009F, 0x00A0, 0x201D, + 0x00A2, 0x00A3, 0x00A4, 0x201E, 0x00A6, 0x00A7, 0x00D8, 0x00A9, + 0x0156, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00C6, 0x00B0, 0x00B1, + 0x00B2, 0x00B3, 0x201C, 0x00B5, 0x00B6, 0x00B7, 0x00F8, 0x00B9, + 0x0157, 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0x00E6, 0x0104, 0x012E, + 0x0100, 0x0106, 0x00C4, 0x00C5, 0x0118, 0x0112, 0x010C, 0x00C9, + 0x0179, 0x0116, 0x0122, 0x0136, 0x012A, 0x013B, 0x0160, 0x0143, + 0x0145, 0x00D3, 0x014C, 0x00D5, 0x00D6, 0x00D7, 0x0172, 0x0141, + 0x015A, 0x016A, 0x00DC, 0x017B, 0x017D, 0x00DF, 0x0105, 0x012F, + 0x0101, 0x0107, 0x00E4, 0x00E5, 0x0119, 0x0113, 0x010D, 0x00E9, + 0x017A, 0x0117, 0x0123, 0x0137, 0x012B, 0x013C, 0x0161, 0x0144, + 0x0146, 0x00F3, 0x014D, 0x00F5, 0x00F6, 0x00F7, 0x0173, 0x0142, + 0x015B, 0x016B, 0x00FC, 0x017C, 0x017E, 0x2019 }; + + public Encoder8859_13(OutputStream out) + { + super(out, "8859_13", lookup_table_8859_13); + } + +} // class Encoder8859_13 + diff --git a/gnu/java/io/encode/Encoder8859_15.java b/gnu/java/io/encode/Encoder8859_15.java new file mode 100644 index 000000000..55d72c095 --- /dev/null +++ b/gnu/java/io/encode/Encoder8859_15.java @@ -0,0 +1,101 @@ +/* Encoder8859_15.java -- Encoder for ISO-Latin-9 Character set. + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package gnu.java.io.encode; + +import java.io.OutputStream; + +/** + * This class encodes bytes in ISO-8859-15 (Latin-9) format to Unicode. + * ISO-8859-15 iso-8859-15 8859-15 8859_15 latin9 Latin9 ISO_8859_15 iso_8859_15 + * ibm-923_P100-1998 ibm-923 Latin-9 l9 8859_15 latin0 csisolatin0 csisolatin9 + * iso8859_15_fdis cp923 923 windows-28605 + * + * @version 0.0 + * @author Quentin Anciaux (quentin.anciaux@advalvas.be) + * @author based on gnu.java.io.encode.Encoder8859_1 by Aaron M. Renn + * (arenn@urbanophile.com) + */ +public class Encoder8859_15 extends EncoderEightBitLookup +{ + + /** + * This is the lookup table for this encoding + */ + private static final char[] lookup_table_8859_15 = + { 0x0000, 0x0001, + 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, + 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F, 0x0010, 0x0011, + 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, + 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F, 0x0020, 0x0021, + 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, + 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F, 0x0030, 0x0031, + 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, + 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F, 0x0040, 0x0041, + 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, + 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F, 0x0050, 0x0051, + 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, + 0x005A, 0x005B, 0x005C, 0x005D, 0x005E, 0x005F, 0x0060, 0x0061, + 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, + 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, 0x0070, 0x0071, + 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, + 0x007A, 0x007B, 0x007C, 0x007D, 0x007E, 0x007F, 0x0080, 0x0081, + 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 0x0088, 0x0089, + 0x008A, 0x008B, 0x008C, 0x008D, 0x008E, 0x008F, 0x0090, 0x0091, + 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 0x0098, 0x0099, + 0x009A, 0x009B, 0x009C, 0x009D, 0x009E, 0x009F, 0x00A0, 0x00A1, + 0x00A2, 0x00A3, 0x20AC, 0x00A5, 0x0160, 0x00A7, 0x0161, 0x00A9, + 0x00AA, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00AF, 0x00B0, 0x00B1, + 0x00B2, 0x00B3, 0x017D, 0x00B5, 0x00B6, 0x00B7, 0x017E, 0x00B9, + 0x00BA, 0x00BB, 0x0152, 0x0153, 0x0178, 0x00BF, 0x00C0, 0x00C1, + 0x00C2, 0x00C3, 0x00C4, 0x00C5, 0x00C6, 0x00C7, 0x00C8, 0x00C9, + 0x00CA, 0x00CB, 0x00CC, 0x00CD, 0x00CE, 0x00CF, 0x00D0, 0x00D1, + 0x00D2, 0x00D3, 0x00D4, 0x00D5, 0x00D6, 0x00D7, 0x00D8, 0x00D9, + 0x00DA, 0x00DB, 0x00DC, 0x00DD, 0x00DE, 0x00DF, 0x00E0, 0x00E1, + 0x00E2, 0x00E3, 0x00E4, 0x00E5, 0x00E6, 0x00E7, 0x00E8, 0x00E9, + 0x00EA, 0x00EB, 0x00EC, 0x00ED, 0x00EE, 0x00EF, 0x00F0, 0x00F1, + 0x00F2, 0x00F3, 0x00F4, 0x00F5, 0x00F6, 0x00F7, 0x00F8, 0x00F9, + 0x00FA, 0x00FB, 0x00FC, 0x00FD, 0x00FE, 0x00FF }; + + public Encoder8859_15(OutputStream out) + { + super(out, "8859_15", lookup_table_8859_15); + } + +} // class Encoder8859_15 + diff --git a/gnu/java/io/encode/Encoder8859_6.java b/gnu/java/io/encode/Encoder8859_6.java new file mode 100644 index 000000000..fea32565a --- /dev/null +++ b/gnu/java/io/encode/Encoder8859_6.java @@ -0,0 +1,345 @@ +/* Encoder8859_6.java -- Encoder for ISO-8859-6 Character set + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package gnu.java.io.encode; + +import java.io.OutputStream; + +/** + * This class encodes bytes in ISO-8859-6 format to Unicode. + * + * 8859_6 + * ibm-1089_P100-1995 + * ibm-1089 + * ISO_8859_6 + * iso_8859_6 + * ISO8859_6 + * iso8859_6 + * ISO-8859-6 + * iso-8859-6 + * arabic + * csISOLatinArabic + * iso-ir-127 + * ISO_8859-6:1987 + * ECMA-114 + * ASMO-708 + * 8859_6 + * cp1089 + * 1089 + * windows-28596 + * ISO-8859-6-I + * ISO-8859-6-E + * + * @version 0.0 + * + * @author Quentin Anciaux (quentin.anciaux@advalvas.be) + * @author based on gnu.java.io.encode.Encoder8859_1 by + * Aaron M. Renn (arenn@urbanophile.com) + */ +public class Encoder8859_6 extends EncoderEightBitLookup +{ + + /** + * This is the lookup table for this encoding + */ + private static final char[] lookup_table_8859_6 = { + 0x0000, + 0x0001, + 0x0002, + 0x0003, + 0x0004, + 0x0005, + 0x0006, + 0x0007, + 0x0008, + 0x0009, + 0x000A, + 0x000B, + 0x000C, + 0x000D, + 0x000E, + 0x000F, + 0x0010, + 0x0011, + 0x0012, + 0x0013, + 0x0014, + 0x0015, + 0x0016, + 0x0017, + 0x0018, + 0x0019, + 0x001A, + 0x001B, + 0x001C, + 0x001D, + 0x001E, + 0x001F, + 0x0020, + 0x0021, + 0x0022, + 0x0023, + 0x0024, + 0x0025, + 0x0026, + 0x0027, + 0x0028, + 0x0029, + 0x002A, + 0x002B, + 0x002C, + 0x002D, + 0x002E, + 0x002F, + 0x0030, + 0x0031, + 0x0032, + 0x0033, + 0x0034, + 0x0035, + 0x0036, + 0x0037, + 0x0038, + 0x0039, + 0x003A, + 0x003B, + 0x003C, + 0x003D, + 0x003E, + 0x003F, + 0x0040, + 0x0041, + 0x0042, + 0x0043, + 0x0044, + 0x0045, + 0x0046, + 0x0047, + 0x0048, + 0x0049, + 0x004A, + 0x004B, + 0x004C, + 0x004D, + 0x004E, + 0x004F, + 0x0050, + 0x0051, + 0x0052, + 0x0053, + 0x0054, + 0x0055, + 0x0056, + 0x0057, + 0x0058, + 0x0059, + 0x005A, + 0x005B, + 0x005C, + 0x005D, + 0x005E, + 0x005F, + 0x0060, + 0x0061, + 0x0062, + 0x0063, + 0x0064, + 0x0065, + 0x0066, + 0x0067, + 0x0068, + 0x0069, + 0x006A, + 0x006B, + 0x006C, + 0x006D, + 0x006E, + 0x006F, + 0x0070, + 0x0071, + 0x0072, + 0x0073, + 0x0074, + 0x0075, + 0x0076, + 0x0077, + 0x0078, + 0x0079, + 0x007A, + 0x007B, + 0x007C, + 0x007D, + 0x007E, + 0x007F, + 0x0080, + 0x0081, + 0x0082, + 0x0083, + 0x0084, + 0x0085, + 0x0086, + 0x0087, + 0x0088, + 0x0089, + 0x008A, + 0x008B, + 0x008C, + 0x008D, + 0x008E, + 0x008F, + 0x0090, + 0x0091, + 0x0092, + 0x0093, + 0x0094, + 0x0095, + 0x0096, + 0x0097, + 0x0098, + 0x0099, + 0x009A, + 0x009B, + 0x009C, + 0x009D, + 0x009E, + 0x009F, + 0x00A0, + 0x0000, + 0x0000, + 0x0000, + 0x00A4, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x060C, + 0x00AD, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x061B, + 0x0000, + 0x0000, + 0x0000, + 0x061F, + 0x0000, + 0x0621, + 0x0622, + 0x0623, + 0x0624, + 0x0625, + 0x0626, + 0x0627, + 0x0628, + 0x0629, + 0x062A, + 0x062B, + 0x062C, + 0x062D, + 0x062E, + 0x062F, + 0x0630, + 0x0631, + 0x0632, + 0x0633, + 0x0634, + 0x0635, + 0x0636, + 0x0637, + 0x0638, + 0x0639, + 0x063A, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0640, + 0x0641, + 0x0642, + 0x0643, + 0x0644, + 0x0645, + 0x0646, + 0x0647, + 0x0648, + 0x0649, + 0x064A, + 0x064B, + 0x064C, + 0x064D, + 0x064E, + 0x064F, + 0x0650, + 0x0651, + 0x0652, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000 + }; + + public Encoder8859_6(OutputStream out) + { + super(out, "8859_6", lookup_table_8859_6); + } + +} // class Encoder8859_6 + diff --git a/gnu/java/io/encode/Encoder8859_7.java b/gnu/java/io/encode/Encoder8859_7.java new file mode 100644 index 000000000..723eec756 --- /dev/null +++ b/gnu/java/io/encode/Encoder8859_7.java @@ -0,0 +1,101 @@ +/* Encoder8859_7.java -- Encoder for ISO-8859-7 Character set. + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package gnu.java.io.encode; + +import java.io.OutputStream; + +/** + * This class encodes bytes in ISO-8859-7 format to Unicode. 8859_7 + * ibm-813_P100-1995 ibm-813 ISO_8859_7 iso_8859_7 ISO8859_7 iso8859_7 + * ISO-8859-7 iso-8859-7 greek greek8 ELOT_928 ECMA-118 csISOLatinGreek + * iso-ir-126 ISO_8859-7:1987 cp813 813 windows-28597 + * + * @version 0.0 + * @author Quentin Anciaux (quentin.anciaux@advalvas.be) + * @author based on gnu.java.io.encode.Encoder8859_1 by Aaron M. Renn + * (arenn@urbanophile.com) + */ +public class Encoder8859_7 extends EncoderEightBitLookup +{ + + /** + * This is the lookup table for this encoding + */ + private static final char[] lookup_table_8859_7 = + { 0x0000, 0x0001, 0x0002, + 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000A, + 0x000B, 0x000C, 0x000D, 0x000E, 0x000F, 0x0010, 0x0011, 0x0012, + 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001A, + 0x001B, 0x001C, 0x001D, 0x001E, 0x001F, 0x0020, 0x0021, 0x0022, + 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002A, + 0x002B, 0x002C, 0x002D, 0x002E, 0x002F, 0x0030, 0x0031, 0x0032, + 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003A, + 0x003B, 0x003C, 0x003D, 0x003E, 0x003F, 0x0040, 0x0041, 0x0042, + 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004A, + 0x004B, 0x004C, 0x004D, 0x004E, 0x004F, 0x0050, 0x0051, 0x0052, + 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005A, + 0x005B, 0x005C, 0x005D, 0x005E, 0x005F, 0x0060, 0x0061, 0x0062, + 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006A, + 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, 0x0070, 0x0071, 0x0072, + 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007A, + 0x007B, 0x007C, 0x007D, 0x007E, 0x007F, 0x0080, 0x0081, 0x0082, + 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 0x0088, 0x0089, 0x008A, + 0x008B, 0x008C, 0x008D, 0x008E, 0x008F, 0x0090, 0x0091, 0x0092, + 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 0x0098, 0x0099, 0x009A, + 0x009B, 0x009C, 0x009D, 0x009E, 0x009F, 0x00A0, 0x2018, 0x2019, + 0x00A3, 0x0000, 0x0000, 0x00A6, 0x00A7, 0x00A8, 0x00A9, 0x0000, + 0x00AB, 0x00AC, 0x00AD, 0x0000, 0x2015, 0x00B0, 0x00B1, 0x00B2, + 0x00B3, 0x00B4, 0x0385, 0x0386, 0x0387, 0x0388, 0x0389, 0x038A, + 0x00BB, 0x038C, 0x00BD, 0x038E, 0x038F, 0x0390, 0x0391, 0x0392, + 0x0393, 0x0394, 0x0395, 0x0396, 0x0397, 0x0398, 0x0399, 0x039A, + 0x039B, 0x039C, 0x039D, 0x039E, 0x039F, 0x03A0, 0x03A1, 0x0000, + 0x03A3, 0x03A4, 0x03A5, 0x03A6, 0x03A7, 0x03A8, 0x03A9, 0x03AA, + 0x03AB, 0x03AC, 0x03AD, 0x03AE, 0x03AF, 0x03B0, 0x03B1, 0x03B2, + 0x03B3, 0x03B4, 0x03B5, 0x03B6, 0x03B7, 0x03B8, 0x03B9, 0x03BA, + 0x03BB, 0x03BC, 0x03BD, 0x03BE, 0x03BF, 0x03C0, 0x03C1, 0x03C2, + 0x03C3, 0x03C4, 0x03C5, 0x03C6, 0x03C7, 0x03C8, 0x03C9, 0x03CA, + 0x03CB, 0x03CC, 0x03CD, 0x03CE, 0x0000 }; + + public Encoder8859_7(OutputStream out) + { + super(out, "8859_7", lookup_table_8859_7); + } + +} // class Encoder8859_7 + diff --git a/gnu/java/io/encode/Encoder8859_8.java b/gnu/java/io/encode/Encoder8859_8.java new file mode 100644 index 000000000..fb3d5852c --- /dev/null +++ b/gnu/java/io/encode/Encoder8859_8.java @@ -0,0 +1,101 @@ +/* Encoder8859_8.java -- Encoder for ISO-8859-8 Character set. + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package gnu.java.io.encode; + +import java.io.OutputStream; + +/** + * This class encodes bytes in ISO-8859-8 format to Unicode. 8859_8 + * ibm-916_P100-1995 ibm-916 ISO_8859_8 iso_8859_8 ISO8859_8 iso8859_8 + * ISO-8859-8 iso-8859-8 hebrew csISOLatinHebrew iso-ir-138 ISO_8859-8:1988 + * ISO-8859-8-I ISO-8859-8-E cp916 916 windows-28598 + * + * @version 0.0 + * @author Quentin Anciaux (quentin.anciaux@advalvas.be) + * @author based on gnu.java.io.encode.Encoder8859_1 by Aaron M. Renn + * (arenn@urbanophile.com) + */ +public class Encoder8859_8 extends EncoderEightBitLookup +{ + + /** + * This is the lookup table for this encoding + */ + private static final char[] lookup_table_8859_8 = + { 0x0000, 0x0001, 0x0002, + 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000A, + 0x000B, 0x000C, 0x000D, 0x000E, 0x000F, 0x0010, 0x0011, 0x0012, + 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001A, + 0x001B, 0x001C, 0x001D, 0x001E, 0x001F, 0x0020, 0x0021, 0x0022, + 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002A, + 0x002B, 0x002C, 0x002D, 0x002E, 0x002F, 0x0030, 0x0031, 0x0032, + 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003A, + 0x003B, 0x003C, 0x003D, 0x003E, 0x003F, 0x0040, 0x0041, 0x0042, + 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004A, + 0x004B, 0x004C, 0x004D, 0x004E, 0x004F, 0x0050, 0x0051, 0x0052, + 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005A, + 0x005B, 0x005C, 0x005D, 0x005E, 0x005F, 0x0060, 0x0061, 0x0062, + 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006A, + 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, 0x0070, 0x0071, 0x0072, + 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007A, + 0x007B, 0x007C, 0x007D, 0x007E, 0x007F, 0x0080, 0x0081, 0x0082, + 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 0x0088, 0x0089, 0x008A, + 0x008B, 0x008C, 0x008D, 0x008E, 0x008F, 0x0090, 0x0091, 0x0092, + 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 0x0098, 0x0099, 0x009A, + 0x009B, 0x009C, 0x009D, 0x009E, 0x009F, 0x00A0, 0x0000, 0x00A2, + 0x00A3, 0x00A4, 0x00A5, 0x00A6, 0x00A7, 0x00A8, 0x00A9, 0x00D7, + 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x203E, 0x00B0, 0x00B1, 0x00B2, + 0x00B3, 0x00B4, 0x00B5, 0x00B6, 0x2022, 0x00B8, 0x00B9, 0x00F7, + 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x2017, 0x05D0, 0x05D1, 0x05D2, + 0x05D3, 0x05D4, 0x05D5, 0x05D6, 0x05D7, 0x05D8, 0x05D9, 0x05DA, + 0x05DB, 0x05DC, 0x05DD, 0x05DE, 0x05DF, 0x05E0, 0x05E1, 0x05E2, + 0x05E3, 0x05E4, 0x05E5, 0x05E6, 0x05E7, 0x05E8, 0x05E9, 0x05EA, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 }; + + public Encoder8859_8(OutputStream out) + { + super(out, "8859_8", lookup_table_8859_8); + } + +} // class Encoder8859_8 + diff --git a/gnu/java/io/encode/Encoder8859_9.java b/gnu/java/io/encode/Encoder8859_9.java new file mode 100644 index 000000000..4478294a3 --- /dev/null +++ b/gnu/java/io/encode/Encoder8859_9.java @@ -0,0 +1,100 @@ +/* Encoder8859_9.java -- Encoder for ISO-Latin-5 Character set. + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package gnu.java.io.encode; + +import java.io.OutputStream; + +/** + * This class encodes bytes in ISO-8859-9 (Latin-5) format to Unicode. + * ibm-920_P100-1995 ibm-920 iso-8859-9 latin5 csISOLatin5 iso-ir-148 + * ISO_8859-9:1989 l5 8859_9 cp920 920 windows-28599 ECMA-128 + * + * @version 0.0 + * @author Quentin Anciaux (quentin.anciaux@advalvas.be) + * @author based on gnu.java.io.encode.Encoder8859_1 by Aaron M. Renn + * (arenn@urbanophile.com) + */ +public class Encoder8859_9 extends EncoderEightBitLookup +{ + + /** + * This is the lookup table for this encoding + */ + private static final char[] lookup_table_8859_9 = + { 0x0000, 0x0001, 0x0002, + 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000A, + 0x000B, 0x000C, 0x000D, 0x000E, 0x000F, 0x0010, 0x0011, 0x0012, + 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001A, + 0x001B, 0x001C, 0x001D, 0x001E, 0x001F, 0x0020, 0x0021, 0x0022, + 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002A, + 0x002B, 0x002C, 0x002D, 0x002E, 0x002F, 0x0030, 0x0031, 0x0032, + 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003A, + 0x003B, 0x003C, 0x003D, 0x003E, 0x003F, 0x0040, 0x0041, 0x0042, + 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004A, + 0x004B, 0x004C, 0x004D, 0x004E, 0x004F, 0x0050, 0x0051, 0x0052, + 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005A, + 0x005B, 0x005C, 0x005D, 0x005E, 0x005F, 0x0060, 0x0061, 0x0062, + 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006A, + 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, 0x0070, 0x0071, 0x0072, + 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007A, + 0x007B, 0x007C, 0x007D, 0x007E, 0x007F, 0x0080, 0x0081, 0x0082, + 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 0x0088, 0x0089, 0x008A, + 0x008B, 0x008C, 0x008D, 0x008E, 0x008F, 0x0090, 0x0091, 0x0092, + 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 0x0098, 0x0099, 0x009A, + 0x009B, 0x009C, 0x009D, 0x009E, 0x009F, 0x00A0, 0x00A1, 0x00A2, + 0x00A3, 0x00A4, 0x00A5, 0x00A6, 0x00A7, 0x00A8, 0x00A9, 0x00AA, + 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00AF, 0x00B0, 0x00B1, 0x00B2, + 0x00B3, 0x00B4, 0x00B5, 0x00B6, 0x00B7, 0x00B8, 0x00B9, 0x00BA, + 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0x00BF, 0x00C0, 0x00C1, 0x00C2, + 0x00C3, 0x00C4, 0x00C5, 0x00C6, 0x00C7, 0x00C8, 0x00C9, 0x00CA, + 0x00CB, 0x00CC, 0x00CD, 0x00CE, 0x00CF, 0x011E, 0x00D1, 0x00D2, + 0x00D3, 0x00D4, 0x00D5, 0x00D6, 0x00D7, 0x00D8, 0x00D9, 0x00DA, + 0x00DB, 0x00DC, 0x0130, 0x015E, 0x00DF, 0x00E0, 0x00E1, 0x00E2, + 0x00E3, 0x00E4, 0x00E5, 0x00E6, 0x00E7, 0x00E8, 0x00E9, 0x00EA, + 0x00EB, 0x00EC, 0x00ED, 0x00EE, 0x00EF, 0x011F, 0x00F1, 0x00F2, + 0x00F3, 0x00F4, 0x00F5, 0x00F6, 0x00F7, 0x00F8, 0x00F9, 0x00FA, + 0x00FB, 0x00FC, 0x0131, 0x015F, 0x00FF }; + + public Encoder8859_9(OutputStream out) + { + super(out, "8859_9", lookup_table_8859_9); + } + +} // class Encoder8859_9 + diff --git a/gnu/java/io/encode/EncoderASCII.java b/gnu/java/io/encode/EncoderASCII.java new file mode 100644 index 000000000..87d07d99e --- /dev/null +++ b/gnu/java/io/encode/EncoderASCII.java @@ -0,0 +1,323 @@ +/* EncoderASCII.java -- Encoder for ASCII Character set + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package gnu.java.io.encode; + +import java.io.OutputStream; + +/** + * This class encodes bytes in ASCII format to Unicode. + * + * @version 0.0 + * + * @author Quentin Anciaux (quentin.anciaux@advalvas.be) + * @author based on gnu.java.io.encode.Encoder8859_1 by + * Aaron M. Renn (arenn@urbanophile.com) + */ +public class EncoderASCII extends EncoderEightBitLookup +{ + + /** + * This is the lookup table for this encoding + */ + private static final char[] lookup_table_ASCII = { + 0x0000, + 0x0001, + 0x0002, + 0x0003, + 0x0004, + 0x0005, + 0x0006, + 0x0007, + 0x0008, + 0x0009, + 0x000A, + 0x000B, + 0x000C, + 0x000D, + 0x000E, + 0x000F, + 0x0010, + 0x0011, + 0x0012, + 0x0013, + 0x0014, + 0x0015, + 0x0016, + 0x0017, + 0x0018, + 0x0019, + 0x001A, + 0x001B, + 0x001C, + 0x001D, + 0x001E, + 0x001F, + 0x0020, + 0x0021, + 0x0022, + 0x0023, + 0x0024, + 0x0025, + 0x0026, + 0x0027, + 0x0028, + 0x0029, + 0x002A, + 0x002B, + 0x002C, + 0x002D, + 0x002E, + 0x002F, + 0x0030, + 0x0031, + 0x0032, + 0x0033, + 0x0034, + 0x0035, + 0x0036, + 0x0037, + 0x0038, + 0x0039, + 0x003A, + 0x003B, + 0x003C, + 0x003D, + 0x003E, + 0x003F, + 0x0040, + 0x0041, + 0x0042, + 0x0043, + 0x0044, + 0x0045, + 0x0046, + 0x0047, + 0x0048, + 0x0049, + 0x004A, + 0x004B, + 0x004C, + 0x004D, + 0x004E, + 0x004F, + 0x0050, + 0x0051, + 0x0052, + 0x0053, + 0x0054, + 0x0055, + 0x0056, + 0x0057, + 0x0058, + 0x0059, + 0x005A, + 0x005B, + 0x005C, + 0x005D, + 0x005E, + 0x005F, + 0x0060, + 0x0061, + 0x0062, + 0x0063, + 0x0064, + 0x0065, + 0x0066, + 0x0067, + 0x0068, + 0x0069, + 0x006A, + 0x006B, + 0x006C, + 0x006D, + 0x006E, + 0x006F, + 0x0070, + 0x0071, + 0x0072, + 0x0073, + 0x0074, + 0x0075, + 0x0076, + 0x0077, + 0x0078, + 0x0079, + 0x007A, + 0x007B, + 0x007C, + 0x007D, + 0x007E, + 0x007F, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000, + 0x0000 + }; + + public EncoderASCII(OutputStream out) + { + super(out, "ASCII", lookup_table_ASCII); + } + +} // class EncoderASCII + diff --git a/gnu/java/io/encode/EncoderCp1047.java b/gnu/java/io/encode/EncoderCp1047.java new file mode 100644 index 000000000..da54602f2 --- /dev/null +++ b/gnu/java/io/encode/EncoderCp1047.java @@ -0,0 +1,100 @@ +/* EncoderCp1047.java -- Encoder for EBCDIC Latin-1 Character set. + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package gnu.java.io.encode; + +import java.io.OutputStream; + +/** + * This class encodes bytes in CP-1047 (EBCDIC Latin-1) format to Unicode. + * ibm-1047_P100-1995 ibm-1047 IBM1047 cpibm1047 cp1047 CP1047 cp-1047 CP-1047 + * ebcdic1047 EBCDIC1047 ebcdic-1047 EBCDIC-1047 + * + * @version 0.0 + * @author Quentin Anciaux (quentin.anciaux@advalvas.be) + * @author based on gnu.java.io.encode.Encoder8859_1 by Aaron M. Renn + * (arenn@urbanophile.com) + */ +public class EncoderCp1047 extends EncoderEightBitLookup +{ + + /** + * This is the lookup table for this encoding + */ + private static final char[] lookup_table_cp1047 = + { 0x0000, 0x0001, 0x0002, + 0x0003, 0x009C, 0x0009, 0x0086, 0x007F, 0x0097, 0x008D, 0x008E, + 0x000B, 0x000C, 0x000D, 0x000E, 0x000F, 0x0010, 0x0011, 0x0012, + 0x0013, 0x009D, 0x0085, 0x0008, 0x0087, 0x0018, 0x0019, 0x0092, + 0x008F, 0x001C, 0x001D, 0x001E, 0x001F, 0x0080, 0x0081, 0x0082, + 0x0083, 0x0084, 0x000A, 0x0017, 0x001B, 0x0088, 0x0089, 0x008A, + 0x008B, 0x008C, 0x0005, 0x0006, 0x0007, 0x0090, 0x0091, 0x0016, + 0x0093, 0x0094, 0x0095, 0x0096, 0x0004, 0x0098, 0x0099, 0x009A, + 0x009B, 0x0014, 0x0015, 0x009E, 0x001A, 0x0020, 0x00A0, 0x00E2, + 0x00E4, 0x00E0, 0x00E1, 0x00E3, 0x00E5, 0x00E7, 0x00F1, 0x00A2, + 0x002E, 0x003C, 0x0028, 0x002B, 0x007C, 0x0026, 0x00E9, 0x00EA, + 0x00EB, 0x00E8, 0x00ED, 0x00EE, 0x00EF, 0x00EC, 0x00DF, 0x0021, + 0x0024, 0x002A, 0x0029, 0x003B, 0x005E, 0x002D, 0x002F, 0x00C2, + 0x00C4, 0x00C0, 0x00C1, 0x00C3, 0x00C5, 0x00C7, 0x00D1, 0x00A6, + 0x002C, 0x0025, 0x005F, 0x003E, 0x003F, 0x00F8, 0x00C9, 0x00CA, + 0x00CB, 0x00C8, 0x00CD, 0x00CE, 0x00CF, 0x00CC, 0x0060, 0x003A, + 0x0023, 0x0040, 0x0027, 0x003D, 0x0022, 0x00D8, 0x0061, 0x0062, + 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x00AB, + 0x00BB, 0x00F0, 0x00FD, 0x00FE, 0x00B1, 0x00B0, 0x006A, 0x006B, + 0x006C, 0x006D, 0x006E, 0x006F, 0x0070, 0x0071, 0x0072, 0x00AA, + 0x00BA, 0x00E6, 0x00B8, 0x00C6, 0x00A4, 0x00B5, 0x007E, 0x0073, + 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007A, 0x00A1, + 0x00BF, 0x00D0, 0x005B, 0x00DE, 0x00AE, 0x00AC, 0x00A3, 0x00A5, + 0x00B7, 0x00A9, 0x00A7, 0x00B6, 0x00BC, 0x00BD, 0x00BE, 0x00DD, + 0x00A8, 0x00AF, 0x005D, 0x00B4, 0x00D7, 0x007B, 0x0041, 0x0042, + 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x00AD, + 0x00F4, 0x00F6, 0x00F2, 0x00F3, 0x00F5, 0x007D, 0x004A, 0x004B, + 0x004C, 0x004D, 0x004E, 0x004F, 0x0050, 0x0051, 0x0052, 0x00B9, + 0x00FB, 0x00FC, 0x00F9, 0x00FA, 0x00FF, 0x005C, 0x00F7, 0x0053, + 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005A, 0x00B2, + 0x00D4, 0x00D6, 0x00D2, 0x00D3, 0x00D5, 0x0030, 0x0031, 0x0032, + 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x00B3, + 0x00DB, 0x00DC, 0x00D9, 0x00DA, 0x009F }; + + public EncoderCp1047(OutputStream out) + { + super(out, "cp1047", lookup_table_cp1047); + } + +} // class EncoderCp1047 + diff --git a/gnu/java/io/encode/EncoderEBCDIC_XML_US.java b/gnu/java/io/encode/EncoderEBCDIC_XML_US.java new file mode 100644 index 000000000..8b619bb6b --- /dev/null +++ b/gnu/java/io/encode/EncoderEBCDIC_XML_US.java @@ -0,0 +1,99 @@ +/* EncoderEBCDIC_XML_US.java -- Encoder for EBCDIC_XML_US Character set. + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package gnu.java.io.encode; + +import java.io.OutputStream; + +/** + * This class encodes bytes in EBCDIC_XML_US format to Unicode. ebcdic-xml-us + * ebcdic EBCDIC EBCDIC-XML-US EBCDIC_XML_US ebcdic_xml_us + * + * @version 0.0 + * @author Quentin Anciaux (quentin.anciaux@advalvas.be) + * @author based on gnu.java.io.encode.Encoder8859_1 by Aaron M. Renn + * (arenn@urbanophile.com) + */ +public class EncoderEBCDIC_XML_US extends EncoderEightBitLookup +{ + /** + * This is the lookup table for this encoding + */ + + private static final char[] lookup_table_ebcdic_xml_us = + { 0x0000, 0x0001, + 0x0002, 0x0003, 0x009C, 0x0009, 0x0086, 0x007F, 0x0097, 0x008D, + 0x008E, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F, 0x0010, 0x0011, + 0x0012, 0x0013, 0x009D, 0x000A, 0x0008, 0x0087, 0x0018, 0x0019, + 0x0092, 0x008F, 0x001C, 0x001D, 0x001E, 0x001F, 0x0080, 0x0081, + 0x0082, 0x0083, 0x0084, 0x000A, 0x0017, 0x001B, 0x0088, 0x0089, + 0x008A, 0x008B, 0x008C, 0x0005, 0x0006, 0x0007, 0x0090, 0x0091, + 0x0016, 0x0093, 0x0094, 0x0095, 0x0096, 0x0004, 0x0098, 0x0099, + 0x009A, 0x009B, 0x0014, 0x0015, 0x009E, 0x001A, 0x0020, 0x00A0, + 0x00E2, 0x00E4, 0x00E0, 0x00E1, 0x00E3, 0x00E5, 0x00E7, 0x00F1, + 0x00A2, 0x002E, 0x003C, 0x0028, 0x002B, 0x007C, 0x0026, 0x00E9, + 0x00EA, 0x00EB, 0x00E8, 0x00ED, 0x00EE, 0x00EF, 0x00EC, 0x00DF, + 0x0021, 0x0024, 0x002A, 0x0029, 0x003B, 0x00AC, 0x002D, 0x002F, + 0x00C2, 0x00C4, 0x00C0, 0x00C1, 0x00C3, 0x00C5, 0x00C7, 0x00D1, + 0x00A6, 0x002C, 0x0025, 0x005F, 0x003E, 0x003F, 0x00F8, 0x00C9, + 0x00CA, 0x00CB, 0x00C8, 0x00CD, 0x00CE, 0x00CF, 0x00CC, 0x0060, + 0x003A, 0x0023, 0x0040, 0x0027, 0x003D, 0x0022, 0x00D8, 0x0061, + 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, + 0x00AB, 0x00BB, 0x00F0, 0x00FD, 0x00FE, 0x00B1, 0x00B0, 0x006A, + 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, 0x0070, 0x0071, 0x0072, + 0x00AA, 0x00BA, 0x00E6, 0x00B8, 0x00C6, 0x20AC, 0x00B5, 0x007E, + 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007A, + 0x00A1, 0x00BF, 0x00D0, 0x00DD, 0x00DE, 0x00AE, 0x005E, 0x00A3, + 0x00A5, 0x00B7, 0x00A9, 0x00A7, 0x00B6, 0x00BC, 0x00BD, 0x00BE, + 0x005B, 0x005D, 0x00AF, 0x00A8, 0x00B4, 0x00D7, 0x007B, 0x0041, + 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, + 0x00AD, 0x00F4, 0x00F6, 0x00F2, 0x00F3, 0x00F5, 0x007D, 0x004A, + 0x004B, 0x004C, 0x004D, 0x004E, 0x004F, 0x0050, 0x0051, 0x0052, + 0x00B9, 0x00FB, 0x00FC, 0x00F9, 0x00FA, 0x00FF, 0x005C, 0x00F7, + 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005A, + 0x00B2, 0x00D4, 0x00D6, 0x00D2, 0x00D3, 0x00D5, 0x0030, 0x0031, + 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, + 0x00B3, 0x00DB, 0x00DC, 0x00D9, 0x00DA, 0x009F }; + + public EncoderEBCDIC_XML_US(OutputStream out) + { + super(out, "ebcdic-xml-us", lookup_table_ebcdic_xml_us); + } + +} // class EncoderEBCDIC_XML_US + diff --git a/gnu/java/io/encode/EncoderUTF16BE.java b/gnu/java/io/encode/EncoderUTF16BE.java new file mode 100644 index 000000000..d3e23ba70 --- /dev/null +++ b/gnu/java/io/encode/EncoderUTF16BE.java @@ -0,0 +1,108 @@ +/* EncoderUTF16BE.java -- Encoder for the UTF-16 Big Endian character encoding. + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package gnu.java.io.encode; + +import java.io.IOException; +import java.io.OutputStream; +import java.math.BigInteger; + +/** + * This class implements character encoding in the UCS Transformation Format 16 + * Big Endian (UTF-16BE) encoding scheme. + * + * @version 0.0 + * @author Quentin Anciaux (quentin.anciaux@advalvas.be) + */ +public class EncoderUTF16BE extends Encoder +{ + + public EncoderUTF16BE(OutputStream out) + { + super(out, "UTF16BE"); + } + + /** + * Returns the number of bytes the specified char array will be encoded + * into + */ + public int bytesInCharArray(char[] buf, int offset, int len) + { + int num_bytes = 0; + for (int i = offset; i < offset + len; i++) + num_bytes += 2; + + return num_bytes; + } + + /** + * This method converts a char array to bytes + */ + public byte[] convertToBytes(char[] buf, int buf_offset, int len, + byte[] bbuf, int bbuf_offset) + { + int val; + // Scan the buffer with full validation checks + for (int i = buf_offset; i < buf_offset + len; i++) { + byte [] newArray = new BigInteger("" + ((int) buf[i])).toByteArray(); + if (newArray.length < 2) + { + bbuf[bbuf_offset++] = 0; + bbuf[bbuf_offset++] = newArray[0]; + } + else + { + bbuf[bbuf_offset++] = newArray[0]; + bbuf[bbuf_offset++] = newArray[1]; + } + } + return bbuf; +} + + /** + * Writes a char array as bytes to the underlying stream. + */ + public void write(char[] buf, int offset, int len) throws IOException + { + byte[] bbuf = new byte[bytesInCharArray(buf, offset, len)]; + convertToBytes(buf, offset, len, bbuf, 0); + out.write(bbuf); + } + +} // class EncoderUTF16BE + diff --git a/gnu/java/io/encode/EncoderUTF16LE.java b/gnu/java/io/encode/EncoderUTF16LE.java new file mode 100644 index 000000000..fc17d3ae4 --- /dev/null +++ b/gnu/java/io/encode/EncoderUTF16LE.java @@ -0,0 +1,111 @@ +/* EncoderUTF16BE.java -- Encoder for the UTF-16 Little Endian character set. + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package gnu.java.io.encode; + +import java.io.IOException; +import java.io.OutputStream; +import java.math.BigInteger; + +/** + * This class implements character encoding in the UCS Transformation Format 16 + * Little Endian (UTF-16LE) encoding scheme. + * + * @version 0.0 + * @author Quentin Anciaux (quentin.anciaux@advalvas.be) + */ +public class EncoderUTF16LE extends Encoder +{ + + public EncoderUTF16LE(OutputStream out) + { + super(out, "UTF16LE"); + } + + /** + * Returns the number of bytes the specified char array will be encoded + * into + */ + public int bytesInCharArray(char[] buf, int offset, int len) + { + int num_bytes = 0; + for (int i = offset; i < offset + len; i++) + num_bytes += 2; + + return num_bytes; + } + + + /** + * This method converts a char array to bytes + */ + public byte[] convertToBytes(char[] buf, int buf_offset, int len, + byte[] bbuf, int bbuf_offset) + { + int val; + // Scan the buffer with full validation checks + for (int i = buf_offset; i < buf_offset + len; i++) + { + byte [] newArray = new BigInteger(""+((int)buf[i])).toByteArray(); + if (newArray.length < 2) + { + bbuf[bbuf_offset++] = newArray[0]; + bbuf[bbuf_offset++] = 0; + } + else + { + bbuf[bbuf_offset++] = newArray[1]; + bbuf[bbuf_offset++] = newArray[0]; + } + } + + return bbuf; + } + + /** + * Writes a char array as bytes to the underlying stream. + */ + public void write(char[] buf, int offset, int len) throws IOException + { + byte[] bbuf = new byte[bytesInCharArray(buf, offset, len)]; + convertToBytes(buf, offset, len, bbuf, 0); + out.write(bbuf); + } + +} // class EncoderUTF16LE + diff --git a/gnu/java/io/encode/EncoderUTF32BE.java b/gnu/java/io/encode/EncoderUTF32BE.java new file mode 100644 index 000000000..afe72e06e --- /dev/null +++ b/gnu/java/io/encode/EncoderUTF32BE.java @@ -0,0 +1,187 @@ +/* EncoderUTF32BE.java -- Encoder for the UTF-32 Big Endian character encoding. + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package gnu.java.io.encode; + +import java.io.IOException; +import java.io.OutputStream; +import java.math.BigInteger; + +/** + * This class implements character encoding in the UCS Transformation Format 32 + * Big Endian (UTF-32BE) encoding scheme. + * + * @version 0.0 + * @author Quentin Anciaux (quentin.anciaux@advalvas.be) + */ +public class EncoderUTF32BE extends Encoder +{ + + public EncoderUTF32BE(OutputStream out) + { + super(out, "UTF32BE"); + } + + /** + * Returns the number of bytes the specified char array will be encoded + * into. + */ + public int bytesInCharArray(char[] buf, int offset, int len) + { + int num_bytes = 0; + for (int i = offset; i < offset + len; ) + { + if (i+1 < offset + len && ((int) buf[i]) >= 0xD800 + && ((int) buf[i]) <= 0xDBFF) + { + // surrogate 2 char makes one char + i += 2; + num_bytes += 4; + continue; + } + else + { + i++; + num_bytes += 4; + continue; + } + } + + return num_bytes; + } + + /** + * This method converts a char array to bytes + */ + public byte[] convertToBytes(char[] buf, int buf_offset, int len, + byte[] bbuf, int bbuf_offset) + { + int val; + // Scan the buffer with full validation checks + for (int i = buf_offset; i < buf_offset + len; ) + { + if (i+1 < buf_offset + len && ((int) buf[i]) >= 0xD800 + && ((int)buf[i]) <= 0xDBFF) + { + // surrogate 2 char makes one char + long codepoint = (((int) buf[i]) << 10) + ((int) buf[i+1]) + + (0x10000 - (0xD800 << 10) - 0xDC00); + byte [] newArray = new BigInteger("" + codepoint).toByteArray(); + if (newArray.length < 2) + { + bbuf[bbuf_offset++] = 0; + bbuf[bbuf_offset++] = 0; + bbuf[bbuf_offset++] = 0; + bbuf[bbuf_offset++] = newArray[0]; + } + else if (newArray.length < 3) + { + bbuf[bbuf_offset++] = 0; + bbuf[bbuf_offset++] = 0; + bbuf[bbuf_offset++] = newArray[0]; + bbuf[bbuf_offset++] = newArray[1]; + } + else if (newArray.length < 4) + { + bbuf[bbuf_offset++] = 0; + bbuf[bbuf_offset++] = newArray[0]; + bbuf[bbuf_offset++] = newArray[1]; + bbuf[bbuf_offset++] = newArray[2]; + } + else + { + bbuf[bbuf_offset++] = newArray[0]; + bbuf[bbuf_offset++] = newArray[1]; + bbuf[bbuf_offset++] = newArray[2]; + bbuf[bbuf_offset++] = newArray[3]; + } + i += 2; + continue; + } + else + { + byte [] newArray; + newArray = new BigInteger("" + ((int) buf[i])).toByteArray(); + if (newArray.length < 2) + { + bbuf[bbuf_offset++] = 0; + bbuf[bbuf_offset++] = 0; + bbuf[bbuf_offset++] = 0; + bbuf[bbuf_offset++] = newArray[0]; + } + else if (newArray.length < 3) + { + bbuf[bbuf_offset++] = 0; + bbuf[bbuf_offset++] = 0; + bbuf[bbuf_offset++] = newArray[0]; + bbuf[bbuf_offset++] = newArray[1]; + } + else if (newArray.length < 4) + { + bbuf[bbuf_offset++] = 0; + bbuf[bbuf_offset++] = newArray[0]; + bbuf[bbuf_offset++] = newArray[1]; + bbuf[bbuf_offset++] = newArray[2]; + } + else + { + bbuf[bbuf_offset++] = newArray[0]; + bbuf[bbuf_offset++] = newArray[1]; + bbuf[bbuf_offset++] = newArray[2]; + bbuf[bbuf_offset++] = newArray[3]; + } + i++; + continue; + } + } + + return bbuf; +} + + /** + * Writes a char array as bytes to the underlying stream. + */ + public void write(char[] buf, int offset, int len) throws IOException + { + byte[] bbuf = new byte[bytesInCharArray(buf, offset, len)]; + convertToBytes(buf, offset, len, bbuf, 0); + out.write(bbuf); + } + +} // class EncoderUTF32BE + diff --git a/gnu/java/io/encode/EncoderUTF32LE.java b/gnu/java/io/encode/EncoderUTF32LE.java new file mode 100644 index 000000000..026c9a72b --- /dev/null +++ b/gnu/java/io/encode/EncoderUTF32LE.java @@ -0,0 +1,187 @@ +/* EncoderUTF32LE.java -- Encoder for the UTF-32 Little Endian character set. + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package gnu.java.io.encode; + +import java.io.IOException; +import java.io.OutputStream; +import java.math.BigInteger; + +/** + * This class implements character encoding in the UCS Transformation Format 32 + * Little Endian (UTF-32LE) encoding scheme. + * + * @version 0.0 + * @author Quentin Anciaux (quentin.anciaux@advalvas.be) + */ +public class EncoderUTF32LE extends Encoder +{ + + public EncoderUTF32LE(OutputStream out) + { + super(out, "UTF32LE"); + } + + /** + * Returns the number of bytes the specified char array will be encoded + * into. + */ + public int bytesInCharArray(char[] buf, int offset, int len) + { + int num_bytes = 0; + for (int i = offset; i < offset + len; ) + { + if (i + 1 < offset + len && ((int) buf[i]) >= 0xD800 + && ((int) buf[i]) <= 0xDBFF) + { + // surrogate 2 char makes one char + i += 2; + num_bytes += 4; + continue; + } + else + { + i++; + num_bytes += 4; + continue; + } + } + + return num_bytes; +} + + /** + * This method converts a char array to bytes + */ + public byte[] convertToBytes(char[] buf, int buf_offset, int len, + byte[] bbuf, int bbuf_offset) + { + int val; + // Scan the buffer with full validation checks + for (int i = buf_offset; i < buf_offset + len; ) + { + if (i + 1 < buf_offset + len && ((int) buf[i]) >= 0xD800 + && ((int)buf[i]) <= 0xDBFF) + { + // surrogate 2 char makes one char + long codepoint = (((int) buf[i]) << 10) + ((int) buf[i+1]) + + (0x10000 - (0xD800 << 10) - 0xDC00); + byte [] newArray = new BigInteger("" + codepoint).toByteArray(); + if (newArray.length < 2) + { + bbuf[bbuf_offset++] = newArray[0]; + bbuf[bbuf_offset++] = 0; + bbuf[bbuf_offset++] = 0; + bbuf[bbuf_offset++] = 0; + } + else if (newArray.length < 3) + { + bbuf[bbuf_offset++] = newArray[1]; + bbuf[bbuf_offset++] = newArray[0]; + bbuf[bbuf_offset++] = 0; + bbuf[bbuf_offset++] = 0; + } + else if (newArray.length < 4) + { + bbuf[bbuf_offset++] = newArray[2]; + bbuf[bbuf_offset++] = newArray[1]; + bbuf[bbuf_offset++] = newArray[0]; + bbuf[bbuf_offset++] = 0; + } + else + { + bbuf[bbuf_offset++] = newArray[3]; + bbuf[bbuf_offset++] = newArray[2]; + bbuf[bbuf_offset++] = newArray[1]; + bbuf[bbuf_offset++] = newArray[0]; + } + i += 2; + continue; + } + else + { + byte [] newArray = new BigInteger(""+((int)buf[i])).toByteArray(); + if (newArray.length < 2) + { + bbuf[bbuf_offset++] = newArray[0]; + bbuf[bbuf_offset++] = 0; + bbuf[bbuf_offset++] = 0; + bbuf[bbuf_offset++] = 0; + } + else if (newArray.length < 3) + { + bbuf[bbuf_offset++] = newArray[1]; + bbuf[bbuf_offset++] = newArray[0]; + bbuf[bbuf_offset++] = 0; + bbuf[bbuf_offset++] = 0; + } + else if (newArray.length < 4) + { + bbuf[bbuf_offset++] = newArray[2]; + bbuf[bbuf_offset++] = newArray[1]; + bbuf[bbuf_offset++] = newArray[0]; + bbuf[bbuf_offset++] = 0; + } + else + { + bbuf[bbuf_offset++] = newArray[3]; + bbuf[bbuf_offset++] = newArray[2]; + bbuf[bbuf_offset++] = newArray[1]; + bbuf[bbuf_offset++] = newArray[0]; + } + i++; + continue; + } + } + + return bbuf; +} + + + /** + * Writes a char array as bytes to the underlying stream. + */ + public void write(char[] buf, int offset, int len) throws IOException + { + byte[] bbuf = new byte[bytesInCharArray(buf, offset, len)]; + convertToBytes(buf, offset, len, bbuf, 0); + out.write(bbuf); + } + +} // class EncoderUTF16LE + diff --git a/gnu/java/io/encode/EncoderWindows1250.java b/gnu/java/io/encode/EncoderWindows1250.java new file mode 100644 index 000000000..b5d9e339c --- /dev/null +++ b/gnu/java/io/encode/EncoderWindows1250.java @@ -0,0 +1,100 @@ +/* EncoderWindows1250.java -- Encoder for Windows-1250 Character set. + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package gnu.java.io.encode; + +import java.io.OutputStream; + +/** + * This class encodes bytes in Windows-1250 format to Unicode. + * ibm-5346_P100-1998 ibm-5346 windows-1250 Windows-1250 cp1250 CP1250 cp-1250 + * CP-1250 Windows1250 windows1250 + * + * @version 0.0 + * @author Quentin Anciaux (quentin.anciaux@advalvas.be) + * @author based on gnu.java.io.encode.Encoder8859_1 by Aaron M. Renn + * (arenn@urbanophile.com) + */ +public class EncoderWindows1250 extends EncoderEightBitLookup +{ + + /** + * This is the lookup table for this encoding + */ + private static final char[] lookup_table_windows_1250 = + { 0x0000, 0x0001, + 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, + 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F, 0x0010, 0x0011, + 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, + 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F, 0x0020, 0x0021, + 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, + 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F, 0x0030, 0x0031, + 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, + 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F, 0x0040, 0x0041, + 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, + 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F, 0x0050, 0x0051, + 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, + 0x005A, 0x005B, 0x005C, 0x005D, 0x005E, 0x005F, 0x0060, 0x0061, + 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, + 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, 0x0070, 0x0071, + 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, + 0x007A, 0x007B, 0x007C, 0x007D, 0x007E, 0x007F, 0x20AC, 0x0081, + 0x201A, 0x0083, 0x201E, 0x2026, 0x2020, 0x2021, 0x0088, 0x2030, + 0x0160, 0x2039, 0x015A, 0x0164, 0x017D, 0x0179, 0x0090, 0x2018, + 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014, 0x0098, 0x2122, + 0x0161, 0x203A, 0x015B, 0x0165, 0x017E, 0x017A, 0x00A0, 0x02C7, + 0x02D8, 0x0141, 0x00A4, 0x0104, 0x00A6, 0x00A7, 0x00A8, 0x00A9, + 0x015E, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x017B, 0x00B0, 0x00B1, + 0x02DB, 0x0142, 0x00B4, 0x00B5, 0x00B6, 0x00B7, 0x00B8, 0x0105, + 0x015F, 0x00BB, 0x013D, 0x02DD, 0x013E, 0x017C, 0x0154, 0x00C1, + 0x00C2, 0x0102, 0x00C4, 0x0139, 0x0106, 0x00C7, 0x010C, 0x00C9, + 0x0118, 0x00CB, 0x011A, 0x00CD, 0x00CE, 0x010E, 0x0110, 0x0143, + 0x0147, 0x00D3, 0x00D4, 0x0150, 0x00D6, 0x00D7, 0x0158, 0x016E, + 0x00DA, 0x0170, 0x00DC, 0x00DD, 0x0162, 0x00DF, 0x0155, 0x00E1, + 0x00E2, 0x0103, 0x00E4, 0x013A, 0x0107, 0x00E7, 0x010D, 0x00E9, + 0x0119, 0x00EB, 0x011B, 0x00ED, 0x00EE, 0x010F, 0x0111, 0x0144, + 0x0148, 0x00F3, 0x00F4, 0x0151, 0x00F6, 0x00F7, 0x0159, 0x016F, + 0x00FA, 0x0171, 0x00FC, 0x00FD, 0x0163, 0x02D9 }; + + public EncoderWindows1250(OutputStream out) + { + super(out, "Windows-1250", lookup_table_windows_1250); + } + +} // class EncoderWindows1250 + diff --git a/gnu/java/io/encode/EncoderWindows1252.java b/gnu/java/io/encode/EncoderWindows1252.java new file mode 100644 index 000000000..f380ef4df --- /dev/null +++ b/gnu/java/io/encode/EncoderWindows1252.java @@ -0,0 +1,100 @@ +/* EncoderWindows1252.java -- Encoder for Windows-1252 Character set. + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package gnu.java.io.encode; + +import java.io.OutputStream; + +/** + * This class encodes bytes in Windows-1252 format to Unicode. + * ibm-5348_P100-1997 ibm-5348 windows-1252 Windows-1252 cp1252 CP1252 cp-1252 + * CP-1252 Windows1252 windows1252 + * + * @version 0.0 + * @author Quentin Anciaux (quentin.anciaux@advalvas.be) + * @author based on gnu.java.io.decode.Encoder8859_1 by Aaron M. Renn + * (arenn@urbanophile.com) + */ +public class EncoderWindows1252 extends EncoderEightBitLookup +{ + + /** + * This is the lookup table for this encoding + */ + private static final char[] lookup_table_windows_1252 = + { 0x0000, 0x0001, + 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, + 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F, 0x0010, 0x0011, + 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, + 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F, 0x0020, 0x0021, + 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, + 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F, 0x0030, 0x0031, + 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, + 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F, 0x0040, 0x0041, + 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, + 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F, 0x0050, 0x0051, + 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, + 0x005A, 0x005B, 0x005C, 0x005D, 0x005E, 0x005F, 0x0060, 0x0061, + 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, + 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, 0x0070, 0x0071, + 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, + 0x007A, 0x007B, 0x007C, 0x007D, 0x007E, 0x007F, 0x20AC, 0x0081, + 0x201A, 0x0192, 0x201E, 0x2026, 0x2020, 0x2021, 0x02C6, 0x2030, + 0x0160, 0x2039, 0x0152, 0x008D, 0x017D, 0x008F, 0x0090, 0x2018, + 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014, 0x02DC, 0x2122, + 0x0161, 0x203A, 0x0153, 0x009D, 0x017E, 0x0178, 0x00A0, 0x00A1, + 0x00A2, 0x00A3, 0x00A4, 0x00A5, 0x00A6, 0x00A7, 0x00A8, 0x00A9, + 0x00AA, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00AF, 0x00B0, 0x00B1, + 0x00B2, 0x00B3, 0x00B4, 0x00B5, 0x00B6, 0x00B7, 0x00B8, 0x00B9, + 0x00BA, 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0x00BF, 0x00C0, 0x00C1, + 0x00C2, 0x00C3, 0x00C4, 0x00C5, 0x00C6, 0x00C7, 0x00C8, 0x00C9, + 0x00CA, 0x00CB, 0x00CC, 0x00CD, 0x00CE, 0x00CF, 0x00D0, 0x00D1, + 0x00D2, 0x00D3, 0x00D4, 0x00D5, 0x00D6, 0x00D7, 0x00D8, 0x00D9, + 0x00DA, 0x00DB, 0x00DC, 0x00DD, 0x00DE, 0x00DF, 0x00E0, 0x00E1, + 0x00E2, 0x00E3, 0x00E4, 0x00E5, 0x00E6, 0x00E7, 0x00E8, 0x00E9, + 0x00EA, 0x00EB, 0x00EC, 0x00ED, 0x00EE, 0x00EF, 0x00F0, 0x00F1, + 0x00F2, 0x00F3, 0x00F4, 0x00F5, 0x00F6, 0x00F7, 0x00F8, 0x00F9, + 0x00FA, 0x00FB, 0x00FC, 0x00FD, 0x00FE, 0x00FF }; + + public EncoderWindows1252(OutputStream out) + { + super(out, "Windows-1252", lookup_table_windows_1252); + } + +} // class EncoderWindows1252 + |