mirror of
https://github.com/ManchildProductions/UXP-Fixed.git
synced 2026-06-12 19:29:14 +00:00
Add java htmlparser sources that match the original 52-level state
https://hg.mozilla.org/projects/htmlparser/ Commit: abe62ab2a9b69ccb3b5d8a231ec1ae11154c571d
This commit is contained in:
@@ -0,0 +1,59 @@
|
||||
/*
|
||||
* Copyright (c) 2013-2015 Mozilla Foundation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* THIS IS A GENERATED FILE. PLEASE DO NOT EDIT.
|
||||
* Instead, please regenerate using generate-encoding-data.py
|
||||
*/
|
||||
|
||||
package nu.validator.encoding;
|
||||
|
||||
import java.nio.charset.Charset;
|
||||
import java.nio.charset.CharsetDecoder;
|
||||
import java.nio.charset.CharsetEncoder;
|
||||
|
||||
class Big5 extends Encoding {
|
||||
|
||||
private static final String[] LABELS = {
|
||||
"big5",
|
||||
"big5-hkscs",
|
||||
"cn-big5",
|
||||
"csbig5",
|
||||
"x-x-big5"
|
||||
};
|
||||
|
||||
private static final String NAME = "big5";
|
||||
|
||||
static final Big5 INSTANCE = new Big5();
|
||||
|
||||
private Big5() {
|
||||
super(NAME, LABELS);
|
||||
}
|
||||
|
||||
@Override public CharsetDecoder newDecoder() {
|
||||
return new Big5Decoder(this);
|
||||
}
|
||||
|
||||
@Override public CharsetEncoder newEncoder() {
|
||||
return new Big5Encoder(this);
|
||||
}
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,184 @@
|
||||
/*
|
||||
* Copyright (c) 2015 Mozilla Foundation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package nu.validator.encoding;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.CharBuffer;
|
||||
import java.nio.charset.Charset;
|
||||
import java.nio.charset.CoderResult;
|
||||
|
||||
public class Big5Decoder extends Decoder {
|
||||
|
||||
private int big5Lead = 0;
|
||||
|
||||
private char pendingTrail = '\u0000';
|
||||
|
||||
protected Big5Decoder(Charset cs) {
|
||||
super(cs, 0.5f, 1.0f);
|
||||
}
|
||||
|
||||
@Override protected CoderResult decodeLoop(ByteBuffer in, CharBuffer out) {
|
||||
assert !(this.report && (big5Lead != 0)):
|
||||
"When reporting, this method should never return with big5Lead set.";
|
||||
if (pendingTrail != '\u0000') {
|
||||
if (!out.hasRemaining()) {
|
||||
return CoderResult.OVERFLOW;
|
||||
}
|
||||
out.put(pendingTrail);
|
||||
pendingTrail = '\u0000';
|
||||
}
|
||||
for (;;) {
|
||||
if (!in.hasRemaining()) {
|
||||
return CoderResult.UNDERFLOW;
|
||||
}
|
||||
if (!out.hasRemaining()) {
|
||||
return CoderResult.OVERFLOW;
|
||||
}
|
||||
int b = ((int) in.get() & 0xFF);
|
||||
if (big5Lead == 0) {
|
||||
if (b <= 0x7F) {
|
||||
out.put((char) b);
|
||||
continue;
|
||||
}
|
||||
if (b >= 0x81 && b <= 0xFE) {
|
||||
if (this.report && !in.hasRemaining()) {
|
||||
// The Java API is badly documented. Need to do this
|
||||
// crazy thing and hope the caller knows about the
|
||||
// undocumented aspects of the API!
|
||||
in.position(in.position() - 1);
|
||||
return CoderResult.UNDERFLOW;
|
||||
}
|
||||
big5Lead = b;
|
||||
continue;
|
||||
}
|
||||
if (this.report) {
|
||||
in.position(in.position() - 1);
|
||||
return CoderResult.malformedForLength(1);
|
||||
}
|
||||
out.put('\uFFFD');
|
||||
continue;
|
||||
}
|
||||
int lead = big5Lead;
|
||||
big5Lead = 0;
|
||||
int offset = (b < 0x7F) ? 0x40 : 0x62;
|
||||
if ((b >= 0x40 && b <= 0x7E) || (b >= 0xA1 && b <= 0xFE)) {
|
||||
int pointer = (lead - 0x81) * 157 + (b - offset);
|
||||
char outTrail;
|
||||
switch (pointer) {
|
||||
case 1133:
|
||||
out.put('\u00CA');
|
||||
outTrail = '\u0304';
|
||||
break;
|
||||
case 1135:
|
||||
out.put('\u00CA');
|
||||
outTrail = '\u030C';
|
||||
break;
|
||||
case 1164:
|
||||
out.put('\u00EA');
|
||||
outTrail = '\u0304';
|
||||
break;
|
||||
case 1166:
|
||||
out.put('\u00EA');
|
||||
outTrail = '\u030C';
|
||||
break;
|
||||
default:
|
||||
char lowBits = Big5Data.lowBits(pointer);
|
||||
if (lowBits == '\u0000') {
|
||||
// The following |if| block fixes
|
||||
// https://github.com/whatwg/encoding/issues/5
|
||||
if (b <= 0x7F) {
|
||||
// prepend byte to stream
|
||||
// Always legal, since we've always just read a byte
|
||||
// if we come here.
|
||||
in.position(in.position() - 1);
|
||||
}
|
||||
if (this.report) {
|
||||
// This can go past the start of the buffer
|
||||
// if the caller does not conform to the
|
||||
// undocumented aspects of the API.
|
||||
in.position(in.position() - 1);
|
||||
return CoderResult.malformedForLength(b <= 0x7F ? 1 : 2);
|
||||
}
|
||||
out.put('\uFFFD');
|
||||
continue;
|
||||
}
|
||||
if (Big5Data.isAstral(pointer)) {
|
||||
int codePoint = lowBits | 0x20000;
|
||||
out.put((char) (0xD7C0 + (codePoint >> 10)));
|
||||
outTrail = (char) (0xDC00 + (codePoint & 0x3FF));
|
||||
break;
|
||||
}
|
||||
out.put(lowBits);
|
||||
continue;
|
||||
}
|
||||
if (!out.hasRemaining()) {
|
||||
pendingTrail = outTrail;
|
||||
return CoderResult.OVERFLOW;
|
||||
}
|
||||
out.put(outTrail);
|
||||
continue;
|
||||
}
|
||||
// pointer is null
|
||||
if (b <= 0x7F) {
|
||||
// prepend byte to stream
|
||||
// Always legal, since we've always just read a byte
|
||||
// if we come here.
|
||||
in.position(in.position() - 1);
|
||||
}
|
||||
if (this.report) {
|
||||
// if position() == 0, the caller is not using the
|
||||
// undocumented part of the API right and the line
|
||||
// below will throw!
|
||||
in.position(in.position() - 1);
|
||||
return CoderResult.malformedForLength(b <= 0x7F ? 1 : 2);
|
||||
}
|
||||
out.put('\uFFFD');
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
@Override protected CoderResult implFlush(CharBuffer out) {
|
||||
if (pendingTrail != '\u0000') {
|
||||
if (!out.hasRemaining()) {
|
||||
return CoderResult.OVERFLOW;
|
||||
}
|
||||
out.put(pendingTrail);
|
||||
pendingTrail = '\u0000';
|
||||
}
|
||||
if (big5Lead != 0) {
|
||||
assert !this.report: "How come big5Lead got to be non-zero when decodeLoop() returned in the reporting mode?";
|
||||
if (!out.hasRemaining()) {
|
||||
return CoderResult.OVERFLOW;
|
||||
}
|
||||
out.put('\uFFFD');
|
||||
big5Lead = 0;
|
||||
}
|
||||
return CoderResult.UNDERFLOW;
|
||||
}
|
||||
|
||||
@Override protected void implReset() {
|
||||
big5Lead = 0;
|
||||
pendingTrail = '\u0000';
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,185 @@
|
||||
/*
|
||||
* Copyright (c) 2015 Mozilla Foundation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package nu.validator.encoding;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.CharBuffer;
|
||||
import java.nio.charset.Charset;
|
||||
import java.nio.charset.CoderResult;
|
||||
|
||||
public class Big5Encoder extends Encoder {
|
||||
|
||||
private char utf16Lead = '\u0000';
|
||||
|
||||
private byte pendingTrail = 0;
|
||||
|
||||
protected Big5Encoder(Charset cs) {
|
||||
super(cs, 1.5f, 2.0f);
|
||||
}
|
||||
|
||||
@Override protected CoderResult encodeLoop(CharBuffer in, ByteBuffer out) {
|
||||
assert !((this.reportMalformed || this.reportUnmappable) && (utf16Lead != '\u0000')):
|
||||
"When reporting, this method should never return with utf16Lead set.";
|
||||
if (pendingTrail != 0) {
|
||||
if (!out.hasRemaining()) {
|
||||
return CoderResult.OVERFLOW;
|
||||
}
|
||||
out.put(pendingTrail);
|
||||
pendingTrail = 0;
|
||||
}
|
||||
for (;;) {
|
||||
if (!in.hasRemaining()) {
|
||||
return CoderResult.UNDERFLOW;
|
||||
}
|
||||
if (!out.hasRemaining()) {
|
||||
return CoderResult.OVERFLOW;
|
||||
}
|
||||
boolean isAstral; // true means Plane 2, false means BMP
|
||||
char lowBits; // The low 16 bits of the code point
|
||||
char codeUnit = in.get();
|
||||
int highBits = (codeUnit & 0xFC00);
|
||||
if (highBits == 0xD800) {
|
||||
// high surrogate
|
||||
if (utf16Lead != '\u0000') {
|
||||
// High surrogate follows another high surrogate. The
|
||||
// *previous* code unit is in error.
|
||||
if (this.reportMalformed) {
|
||||
// The caller had better adhere to the API contract.
|
||||
// Otherwise, this may throw.
|
||||
in.position(in.position() - 2);
|
||||
utf16Lead = '\u0000';
|
||||
return CoderResult.malformedForLength(1);
|
||||
}
|
||||
out.put((byte) '?');
|
||||
}
|
||||
utf16Lead = codeUnit;
|
||||
continue;
|
||||
}
|
||||
if (highBits == 0xDC00) {
|
||||
// low surrogate
|
||||
if (utf16Lead == '\u0000') {
|
||||
// Got low surrogate without a previous high surrogate
|
||||
if (this.reportMalformed) {
|
||||
in.position(in.position() - 1);
|
||||
return CoderResult.malformedForLength(1);
|
||||
}
|
||||
out.put((byte) '?');
|
||||
continue;
|
||||
}
|
||||
int codePoint = (utf16Lead << 10) + codeUnit - 56613888;
|
||||
utf16Lead = '\u0000';
|
||||
// Plane 2 is the only astral plane that has potentially
|
||||
// Big5-encodable characters.
|
||||
if ((0xFF0000 & codePoint) != 0x20000) {
|
||||
if (this.reportUnmappable) {
|
||||
in.position(in.position() - 2);
|
||||
return CoderResult.unmappableForLength(2);
|
||||
}
|
||||
out.put((byte) '?');
|
||||
continue;
|
||||
}
|
||||
isAstral = true;
|
||||
lowBits = (char)(codePoint & 0xFFFF);
|
||||
} else {
|
||||
// not a surrogate
|
||||
if (utf16Lead != '\u0000') {
|
||||
// Non-surrogate follows a high surrogate. The *previous*
|
||||
// code unit is in error.
|
||||
utf16Lead = '\u0000';
|
||||
if (this.reportMalformed) {
|
||||
// The caller had better adhere to the API contract.
|
||||
// Otherwise, this may throw.
|
||||
in.position(in.position() - 2);
|
||||
return CoderResult.malformedForLength(1);
|
||||
}
|
||||
out.put((byte) '?');
|
||||
// Let's unconsume this code unit and reloop in order to
|
||||
// re-check if the output buffer still has space.
|
||||
in.position(in.position() - 1);
|
||||
continue;
|
||||
}
|
||||
isAstral = false;
|
||||
lowBits = codeUnit;
|
||||
}
|
||||
// isAstral now tells us if we have a Plane 2 or a BMP character.
|
||||
// lowBits tells us the low 16 bits.
|
||||
// After all the above setup to deal with UTF-16, we are now
|
||||
// finally ready to follow the spec.
|
||||
if (!isAstral && lowBits <= 0x7F) {
|
||||
out.put((byte)lowBits);
|
||||
continue;
|
||||
}
|
||||
int pointer = Big5Data.findPointer(lowBits, isAstral);
|
||||
if (pointer == 0) {
|
||||
if (this.reportUnmappable) {
|
||||
if (isAstral) {
|
||||
in.position(in.position() - 2);
|
||||
return CoderResult.unmappableForLength(2);
|
||||
}
|
||||
in.position(in.position() - 1);
|
||||
return CoderResult.unmappableForLength(1);
|
||||
}
|
||||
out.put((byte)'?');
|
||||
continue;
|
||||
}
|
||||
int lead = pointer / 157 + 0x81;
|
||||
int trail = pointer % 157;
|
||||
if (trail < 0x3F) {
|
||||
trail += 0x40;
|
||||
} else {
|
||||
trail += 0x62;
|
||||
}
|
||||
out.put((byte)lead);
|
||||
if (!out.hasRemaining()) {
|
||||
pendingTrail = (byte)trail;
|
||||
return CoderResult.OVERFLOW;
|
||||
}
|
||||
out.put((byte)trail);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
@Override protected CoderResult implFlush(ByteBuffer out) {
|
||||
if (pendingTrail != 0) {
|
||||
if (!out.hasRemaining()) {
|
||||
return CoderResult.OVERFLOW;
|
||||
}
|
||||
out.put(pendingTrail);
|
||||
pendingTrail = 0;
|
||||
}
|
||||
if (utf16Lead != '\u0000') {
|
||||
assert !this.reportMalformed: "How come utf16Lead got to be non-zero when decodeLoop() returned in the reporting mode?";
|
||||
if (!out.hasRemaining()) {
|
||||
return CoderResult.OVERFLOW;
|
||||
}
|
||||
out.put((byte)'?');
|
||||
utf16Lead = '\u0000';
|
||||
}
|
||||
return CoderResult.UNDERFLOW;
|
||||
}
|
||||
|
||||
@Override protected void implReset() {
|
||||
utf16Lead = '\u0000';
|
||||
pendingTrail = 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
/*
|
||||
* Copyright (c) 2015 Mozilla Foundation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package nu.validator.encoding;
|
||||
import java.nio.charset.Charset;
|
||||
import java.nio.charset.CharsetDecoder;
|
||||
import java.nio.charset.CodingErrorAction;
|
||||
|
||||
public abstract class Decoder extends CharsetDecoder {
|
||||
|
||||
protected boolean report = true;
|
||||
|
||||
protected Decoder(Charset cs, float averageCharsPerByte, float maxCharsPerByte) {
|
||||
super(cs, averageCharsPerByte, maxCharsPerByte);
|
||||
}
|
||||
|
||||
@Override protected final void implOnMalformedInput(CodingErrorAction newAction) {
|
||||
if (newAction == null) {
|
||||
throw new IllegalArgumentException("The argument must not be null.");
|
||||
}
|
||||
if (newAction == CodingErrorAction.IGNORE) {
|
||||
throw new IllegalArgumentException("The Encoding Standard does not allow errors to be ignored.");
|
||||
}
|
||||
if (newAction == CodingErrorAction.REPLACE) {
|
||||
this.report = false;
|
||||
return;
|
||||
}
|
||||
if (newAction == CodingErrorAction.REPORT) {
|
||||
this.report = true;
|
||||
return;
|
||||
}
|
||||
assert false: "Unreachable.";
|
||||
throw new IllegalArgumentException("Unknown CodingErrorAction.");
|
||||
}
|
||||
|
||||
@Override protected final void implOnUnmappableCharacter(
|
||||
CodingErrorAction newAction) {
|
||||
if (newAction == null) {
|
||||
throw new IllegalArgumentException("The argument must not be null.");
|
||||
}
|
||||
if (newAction == CodingErrorAction.IGNORE) {
|
||||
throw new IllegalArgumentException("The Encoding Standard does not allow errors to be ignored.");
|
||||
}
|
||||
if (newAction == CodingErrorAction.REPLACE) {
|
||||
return; // We don't actually care, since there are no unmappables.
|
||||
}
|
||||
if (newAction == CodingErrorAction.REPORT) {
|
||||
return; // We don't actually care, since there are no unmappables.
|
||||
}
|
||||
assert false: "Unreachable.";
|
||||
throw new IllegalArgumentException("Unknown CodingErrorAction.");
|
||||
}
|
||||
|
||||
@Override protected final void implReplaceWith(String newReplacement) {
|
||||
if (!"\uFFFD".equals(newReplacement)) {
|
||||
throw new IllegalArgumentException("Only U+FFFD is allowed as the replacement.");
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: Check if the JDK decoders reset the reporting state on reset()
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
/*
|
||||
* Copyright (c) 2015 Mozilla Foundation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package nu.validator.encoding;
|
||||
|
||||
import java.nio.charset.Charset;
|
||||
import java.nio.charset.CharsetEncoder;
|
||||
import java.nio.charset.CodingErrorAction;
|
||||
|
||||
public abstract class Encoder extends CharsetEncoder {
|
||||
|
||||
boolean reportMalformed = true;
|
||||
|
||||
boolean reportUnmappable = true;
|
||||
|
||||
protected Encoder(Charset cs, float averageBytesPerChar,
|
||||
float maxBytesPerChar) {
|
||||
super(cs, averageBytesPerChar, maxBytesPerChar);
|
||||
}
|
||||
|
||||
@Override protected final void implOnMalformedInput(CodingErrorAction newAction) {
|
||||
if (newAction == null) {
|
||||
throw new IllegalArgumentException("The argument must not be null.");
|
||||
}
|
||||
if (newAction == CodingErrorAction.IGNORE) {
|
||||
throw new IllegalArgumentException("The Encoding Standard does not allow errors to be ignored.");
|
||||
}
|
||||
if (newAction == CodingErrorAction.REPLACE) {
|
||||
this.reportMalformed = false;
|
||||
return;
|
||||
}
|
||||
if (newAction == CodingErrorAction.REPORT) {
|
||||
this.reportUnmappable = true;
|
||||
return;
|
||||
}
|
||||
assert false: "Unreachable.";
|
||||
throw new IllegalArgumentException("Unknown CodingErrorAction.");
|
||||
}
|
||||
|
||||
@Override protected final void implOnUnmappableCharacter(
|
||||
CodingErrorAction newAction) {
|
||||
if (newAction == null) {
|
||||
throw new IllegalArgumentException("The argument must not be null.");
|
||||
}
|
||||
if (newAction == CodingErrorAction.IGNORE) {
|
||||
throw new IllegalArgumentException("The Encoding Standard does not allow errors to be ignored.");
|
||||
}
|
||||
if (newAction == CodingErrorAction.REPLACE) {
|
||||
this.reportUnmappable = false;
|
||||
return;
|
||||
}
|
||||
if (newAction == CodingErrorAction.REPORT) {
|
||||
this.reportMalformed = true;
|
||||
return;
|
||||
}
|
||||
assert false: "Unreachable.";
|
||||
throw new IllegalArgumentException("Unknown CodingErrorAction.");
|
||||
}
|
||||
|
||||
@Override public boolean isLegalReplacement(byte[] repl) {
|
||||
if (repl == null) {
|
||||
return false;
|
||||
}
|
||||
if (repl.length != 1) {
|
||||
return false;
|
||||
}
|
||||
if (repl[0] != '?') {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override protected final void implReplaceWith(byte[] newReplacement) {
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,886 @@
|
||||
/*
|
||||
* Copyright (c) 2015 Mozilla Foundation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package nu.validator.encoding;
|
||||
|
||||
import java.nio.charset.Charset;
|
||||
import java.nio.charset.CharsetEncoder;
|
||||
import java.nio.charset.IllegalCharsetNameException;
|
||||
import java.nio.charset.UnsupportedCharsetException;
|
||||
import java.nio.charset.spi.CharsetProvider;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.SortedMap;
|
||||
import java.util.TreeMap;
|
||||
|
||||
/**
|
||||
* Represents an <a href="https://encoding.spec.whatwg.org/#encoding">encoding</a>
|
||||
* as defined in the <a href="https://encoding.spec.whatwg.org/">Encoding
|
||||
* Standard</a>, provides access to each encoding defined in the Encoding
|
||||
* Standard via a static constant and provides the
|
||||
* "<a href="https://encoding.spec.whatwg.org/#concept-encoding-get">get an
|
||||
* encoding</a>" algorithm defined in the Encoding Standard.
|
||||
*
|
||||
* <p>This class inherits from {@link Charset} to allow the Encoding
|
||||
* Standard-compliant encodings to be used in contexts that support
|
||||
* <code>Charset</code> instances. However, by design, the Encoding
|
||||
* Standard-compliant encodings are not supplied via a {@link CharsetProvider}
|
||||
* and, therefore, are not available via and do not interfere with the static
|
||||
* methods provided by <code>Charset</code>. (This class provides methods of
|
||||
* the same name to hide each static method of <code>Charset</code> to help
|
||||
* avoid accidental calls to the static methods of the superclass when working
|
||||
* with Encoding Standard-compliant encodings.)
|
||||
*
|
||||
* <p>When an application needs to use a particular encoding, such as utf-8
|
||||
* or windows-1252, the corresponding constant, i.e.
|
||||
* {@link #UTF_8 Encoding.UTF_8} and {@link #WINDOWS_1252 Encoding.WINDOWS_1252}
|
||||
* respectively, should be used. However, when the application receives an
|
||||
* encoding label from external input, the method {@link #forName(String)
|
||||
* forName()} should be used to obtain the object representing the encoding
|
||||
* identified by the label. In contexts where labels that map to the
|
||||
* <a href="https://encoding.spec.whatwg.org/#replacement">replacement
|
||||
* encoding</a> should be treated as unknown, the method {@link
|
||||
* #forNameNoReplacement(String) forNameNoReplacement()} should be used instead.
|
||||
*
|
||||
*
|
||||
* @author hsivonen
|
||||
*/
|
||||
public abstract class Encoding extends Charset {
|
||||
|
||||
private static final String[] LABELS = {
|
||||
"866",
|
||||
"ansi_x3.4-1968",
|
||||
"arabic",
|
||||
"ascii",
|
||||
"asmo-708",
|
||||
"big5",
|
||||
"big5-hkscs",
|
||||
"chinese",
|
||||
"cn-big5",
|
||||
"cp1250",
|
||||
"cp1251",
|
||||
"cp1252",
|
||||
"cp1253",
|
||||
"cp1254",
|
||||
"cp1255",
|
||||
"cp1256",
|
||||
"cp1257",
|
||||
"cp1258",
|
||||
"cp819",
|
||||
"cp866",
|
||||
"csbig5",
|
||||
"cseuckr",
|
||||
"cseucpkdfmtjapanese",
|
||||
"csgb2312",
|
||||
"csibm866",
|
||||
"csiso2022jp",
|
||||
"csiso2022kr",
|
||||
"csiso58gb231280",
|
||||
"csiso88596e",
|
||||
"csiso88596i",
|
||||
"csiso88598e",
|
||||
"csiso88598i",
|
||||
"csisolatin1",
|
||||
"csisolatin2",
|
||||
"csisolatin3",
|
||||
"csisolatin4",
|
||||
"csisolatin5",
|
||||
"csisolatin6",
|
||||
"csisolatin9",
|
||||
"csisolatinarabic",
|
||||
"csisolatincyrillic",
|
||||
"csisolatingreek",
|
||||
"csisolatinhebrew",
|
||||
"cskoi8r",
|
||||
"csksc56011987",
|
||||
"csmacintosh",
|
||||
"csshiftjis",
|
||||
"cyrillic",
|
||||
"dos-874",
|
||||
"ecma-114",
|
||||
"ecma-118",
|
||||
"elot_928",
|
||||
"euc-jp",
|
||||
"euc-kr",
|
||||
"gb18030",
|
||||
"gb2312",
|
||||
"gb_2312",
|
||||
"gb_2312-80",
|
||||
"gbk",
|
||||
"greek",
|
||||
"greek8",
|
||||
"hebrew",
|
||||
"hz-gb-2312",
|
||||
"ibm819",
|
||||
"ibm866",
|
||||
"iso-2022-cn",
|
||||
"iso-2022-cn-ext",
|
||||
"iso-2022-jp",
|
||||
"iso-2022-kr",
|
||||
"iso-8859-1",
|
||||
"iso-8859-10",
|
||||
"iso-8859-11",
|
||||
"iso-8859-13",
|
||||
"iso-8859-14",
|
||||
"iso-8859-15",
|
||||
"iso-8859-16",
|
||||
"iso-8859-2",
|
||||
"iso-8859-3",
|
||||
"iso-8859-4",
|
||||
"iso-8859-5",
|
||||
"iso-8859-6",
|
||||
"iso-8859-6-e",
|
||||
"iso-8859-6-i",
|
||||
"iso-8859-7",
|
||||
"iso-8859-8",
|
||||
"iso-8859-8-e",
|
||||
"iso-8859-8-i",
|
||||
"iso-8859-9",
|
||||
"iso-ir-100",
|
||||
"iso-ir-101",
|
||||
"iso-ir-109",
|
||||
"iso-ir-110",
|
||||
"iso-ir-126",
|
||||
"iso-ir-127",
|
||||
"iso-ir-138",
|
||||
"iso-ir-144",
|
||||
"iso-ir-148",
|
||||
"iso-ir-149",
|
||||
"iso-ir-157",
|
||||
"iso-ir-58",
|
||||
"iso8859-1",
|
||||
"iso8859-10",
|
||||
"iso8859-11",
|
||||
"iso8859-13",
|
||||
"iso8859-14",
|
||||
"iso8859-15",
|
||||
"iso8859-2",
|
||||
"iso8859-3",
|
||||
"iso8859-4",
|
||||
"iso8859-5",
|
||||
"iso8859-6",
|
||||
"iso8859-7",
|
||||
"iso8859-8",
|
||||
"iso8859-9",
|
||||
"iso88591",
|
||||
"iso885910",
|
||||
"iso885911",
|
||||
"iso885913",
|
||||
"iso885914",
|
||||
"iso885915",
|
||||
"iso88592",
|
||||
"iso88593",
|
||||
"iso88594",
|
||||
"iso88595",
|
||||
"iso88596",
|
||||
"iso88597",
|
||||
"iso88598",
|
||||
"iso88599",
|
||||
"iso_8859-1",
|
||||
"iso_8859-15",
|
||||
"iso_8859-1:1987",
|
||||
"iso_8859-2",
|
||||
"iso_8859-2:1987",
|
||||
"iso_8859-3",
|
||||
"iso_8859-3:1988",
|
||||
"iso_8859-4",
|
||||
"iso_8859-4:1988",
|
||||
"iso_8859-5",
|
||||
"iso_8859-5:1988",
|
||||
"iso_8859-6",
|
||||
"iso_8859-6:1987",
|
||||
"iso_8859-7",
|
||||
"iso_8859-7:1987",
|
||||
"iso_8859-8",
|
||||
"iso_8859-8:1988",
|
||||
"iso_8859-9",
|
||||
"iso_8859-9:1989",
|
||||
"koi",
|
||||
"koi8",
|
||||
"koi8-r",
|
||||
"koi8-ru",
|
||||
"koi8-u",
|
||||
"koi8_r",
|
||||
"korean",
|
||||
"ks_c_5601-1987",
|
||||
"ks_c_5601-1989",
|
||||
"ksc5601",
|
||||
"ksc_5601",
|
||||
"l1",
|
||||
"l2",
|
||||
"l3",
|
||||
"l4",
|
||||
"l5",
|
||||
"l6",
|
||||
"l9",
|
||||
"latin1",
|
||||
"latin2",
|
||||
"latin3",
|
||||
"latin4",
|
||||
"latin5",
|
||||
"latin6",
|
||||
"logical",
|
||||
"mac",
|
||||
"macintosh",
|
||||
"ms932",
|
||||
"ms_kanji",
|
||||
"shift-jis",
|
||||
"shift_jis",
|
||||
"sjis",
|
||||
"sun_eu_greek",
|
||||
"tis-620",
|
||||
"unicode-1-1-utf-8",
|
||||
"us-ascii",
|
||||
"utf-16",
|
||||
"utf-16be",
|
||||
"utf-16le",
|
||||
"utf-8",
|
||||
"utf8",
|
||||
"visual",
|
||||
"windows-1250",
|
||||
"windows-1251",
|
||||
"windows-1252",
|
||||
"windows-1253",
|
||||
"windows-1254",
|
||||
"windows-1255",
|
||||
"windows-1256",
|
||||
"windows-1257",
|
||||
"windows-1258",
|
||||
"windows-31j",
|
||||
"windows-874",
|
||||
"windows-949",
|
||||
"x-cp1250",
|
||||
"x-cp1251",
|
||||
"x-cp1252",
|
||||
"x-cp1253",
|
||||
"x-cp1254",
|
||||
"x-cp1255",
|
||||
"x-cp1256",
|
||||
"x-cp1257",
|
||||
"x-cp1258",
|
||||
"x-euc-jp",
|
||||
"x-gbk",
|
||||
"x-mac-cyrillic",
|
||||
"x-mac-roman",
|
||||
"x-mac-ukrainian",
|
||||
"x-sjis",
|
||||
"x-user-defined",
|
||||
"x-x-big5",
|
||||
};
|
||||
|
||||
private static final Encoding[] ENCODINGS_FOR_LABELS = {
|
||||
Ibm866.INSTANCE,
|
||||
Windows1252.INSTANCE,
|
||||
Iso6.INSTANCE,
|
||||
Windows1252.INSTANCE,
|
||||
Iso6.INSTANCE,
|
||||
Big5.INSTANCE,
|
||||
Big5.INSTANCE,
|
||||
Gbk.INSTANCE,
|
||||
Big5.INSTANCE,
|
||||
Windows1250.INSTANCE,
|
||||
Windows1251.INSTANCE,
|
||||
Windows1252.INSTANCE,
|
||||
Windows1253.INSTANCE,
|
||||
Windows1254.INSTANCE,
|
||||
Windows1255.INSTANCE,
|
||||
Windows1256.INSTANCE,
|
||||
Windows1257.INSTANCE,
|
||||
Windows1258.INSTANCE,
|
||||
Windows1252.INSTANCE,
|
||||
Ibm866.INSTANCE,
|
||||
Big5.INSTANCE,
|
||||
EucKr.INSTANCE,
|
||||
EucJp.INSTANCE,
|
||||
Gbk.INSTANCE,
|
||||
Ibm866.INSTANCE,
|
||||
Iso2022Jp.INSTANCE,
|
||||
Replacement.INSTANCE,
|
||||
Gbk.INSTANCE,
|
||||
Iso6.INSTANCE,
|
||||
Iso6.INSTANCE,
|
||||
Iso8.INSTANCE,
|
||||
Iso8I.INSTANCE,
|
||||
Windows1252.INSTANCE,
|
||||
Iso2.INSTANCE,
|
||||
Iso3.INSTANCE,
|
||||
Iso4.INSTANCE,
|
||||
Windows1254.INSTANCE,
|
||||
Iso10.INSTANCE,
|
||||
Iso15.INSTANCE,
|
||||
Iso6.INSTANCE,
|
||||
Iso5.INSTANCE,
|
||||
Iso7.INSTANCE,
|
||||
Iso8.INSTANCE,
|
||||
Koi8R.INSTANCE,
|
||||
EucKr.INSTANCE,
|
||||
Macintosh.INSTANCE,
|
||||
ShiftJis.INSTANCE,
|
||||
Iso5.INSTANCE,
|
||||
Windows874.INSTANCE,
|
||||
Iso6.INSTANCE,
|
||||
Iso7.INSTANCE,
|
||||
Iso7.INSTANCE,
|
||||
EucJp.INSTANCE,
|
||||
EucKr.INSTANCE,
|
||||
Gb18030.INSTANCE,
|
||||
Gbk.INSTANCE,
|
||||
Gbk.INSTANCE,
|
||||
Gbk.INSTANCE,
|
||||
Gbk.INSTANCE,
|
||||
Iso7.INSTANCE,
|
||||
Iso7.INSTANCE,
|
||||
Iso8.INSTANCE,
|
||||
Replacement.INSTANCE,
|
||||
Windows1252.INSTANCE,
|
||||
Ibm866.INSTANCE,
|
||||
Replacement.INSTANCE,
|
||||
Replacement.INSTANCE,
|
||||
Iso2022Jp.INSTANCE,
|
||||
Replacement.INSTANCE,
|
||||
Windows1252.INSTANCE,
|
||||
Iso10.INSTANCE,
|
||||
Windows874.INSTANCE,
|
||||
Iso13.INSTANCE,
|
||||
Iso14.INSTANCE,
|
||||
Iso15.INSTANCE,
|
||||
Iso16.INSTANCE,
|
||||
Iso2.INSTANCE,
|
||||
Iso3.INSTANCE,
|
||||
Iso4.INSTANCE,
|
||||
Iso5.INSTANCE,
|
||||
Iso6.INSTANCE,
|
||||
Iso6.INSTANCE,
|
||||
Iso6.INSTANCE,
|
||||
Iso7.INSTANCE,
|
||||
Iso8.INSTANCE,
|
||||
Iso8.INSTANCE,
|
||||
Iso8I.INSTANCE,
|
||||
Windows1254.INSTANCE,
|
||||
Windows1252.INSTANCE,
|
||||
Iso2.INSTANCE,
|
||||
Iso3.INSTANCE,
|
||||
Iso4.INSTANCE,
|
||||
Iso7.INSTANCE,
|
||||
Iso6.INSTANCE,
|
||||
Iso8.INSTANCE,
|
||||
Iso5.INSTANCE,
|
||||
Windows1254.INSTANCE,
|
||||
EucKr.INSTANCE,
|
||||
Iso10.INSTANCE,
|
||||
Gbk.INSTANCE,
|
||||
Windows1252.INSTANCE,
|
||||
Iso10.INSTANCE,
|
||||
Windows874.INSTANCE,
|
||||
Iso13.INSTANCE,
|
||||
Iso14.INSTANCE,
|
||||
Iso15.INSTANCE,
|
||||
Iso2.INSTANCE,
|
||||
Iso3.INSTANCE,
|
||||
Iso4.INSTANCE,
|
||||
Iso5.INSTANCE,
|
||||
Iso6.INSTANCE,
|
||||
Iso7.INSTANCE,
|
||||
Iso8.INSTANCE,
|
||||
Windows1254.INSTANCE,
|
||||
Windows1252.INSTANCE,
|
||||
Iso10.INSTANCE,
|
||||
Windows874.INSTANCE,
|
||||
Iso13.INSTANCE,
|
||||
Iso14.INSTANCE,
|
||||
Iso15.INSTANCE,
|
||||
Iso2.INSTANCE,
|
||||
Iso3.INSTANCE,
|
||||
Iso4.INSTANCE,
|
||||
Iso5.INSTANCE,
|
||||
Iso6.INSTANCE,
|
||||
Iso7.INSTANCE,
|
||||
Iso8.INSTANCE,
|
||||
Windows1254.INSTANCE,
|
||||
Windows1252.INSTANCE,
|
||||
Iso15.INSTANCE,
|
||||
Windows1252.INSTANCE,
|
||||
Iso2.INSTANCE,
|
||||
Iso2.INSTANCE,
|
||||
Iso3.INSTANCE,
|
||||
Iso3.INSTANCE,
|
||||
Iso4.INSTANCE,
|
||||
Iso4.INSTANCE,
|
||||
Iso5.INSTANCE,
|
||||
Iso5.INSTANCE,
|
||||
Iso6.INSTANCE,
|
||||
Iso6.INSTANCE,
|
||||
Iso7.INSTANCE,
|
||||
Iso7.INSTANCE,
|
||||
Iso8.INSTANCE,
|
||||
Iso8.INSTANCE,
|
||||
Windows1254.INSTANCE,
|
||||
Windows1254.INSTANCE,
|
||||
Koi8R.INSTANCE,
|
||||
Koi8R.INSTANCE,
|
||||
Koi8R.INSTANCE,
|
||||
Koi8U.INSTANCE,
|
||||
Koi8U.INSTANCE,
|
||||
Koi8R.INSTANCE,
|
||||
EucKr.INSTANCE,
|
||||
EucKr.INSTANCE,
|
||||
EucKr.INSTANCE,
|
||||
EucKr.INSTANCE,
|
||||
EucKr.INSTANCE,
|
||||
Windows1252.INSTANCE,
|
||||
Iso2.INSTANCE,
|
||||
Iso3.INSTANCE,
|
||||
Iso4.INSTANCE,
|
||||
Windows1254.INSTANCE,
|
||||
Iso10.INSTANCE,
|
||||
Iso15.INSTANCE,
|
||||
Windows1252.INSTANCE,
|
||||
Iso2.INSTANCE,
|
||||
Iso3.INSTANCE,
|
||||
Iso4.INSTANCE,
|
||||
Windows1254.INSTANCE,
|
||||
Iso10.INSTANCE,
|
||||
Iso8I.INSTANCE,
|
||||
Macintosh.INSTANCE,
|
||||
Macintosh.INSTANCE,
|
||||
ShiftJis.INSTANCE,
|
||||
ShiftJis.INSTANCE,
|
||||
ShiftJis.INSTANCE,
|
||||
ShiftJis.INSTANCE,
|
||||
ShiftJis.INSTANCE,
|
||||
Iso7.INSTANCE,
|
||||
Windows874.INSTANCE,
|
||||
Utf8.INSTANCE,
|
||||
Windows1252.INSTANCE,
|
||||
Utf16Le.INSTANCE,
|
||||
Utf16Be.INSTANCE,
|
||||
Utf16Le.INSTANCE,
|
||||
Utf8.INSTANCE,
|
||||
Utf8.INSTANCE,
|
||||
Iso8.INSTANCE,
|
||||
Windows1250.INSTANCE,
|
||||
Windows1251.INSTANCE,
|
||||
Windows1252.INSTANCE,
|
||||
Windows1253.INSTANCE,
|
||||
Windows1254.INSTANCE,
|
||||
Windows1255.INSTANCE,
|
||||
Windows1256.INSTANCE,
|
||||
Windows1257.INSTANCE,
|
||||
Windows1258.INSTANCE,
|
||||
ShiftJis.INSTANCE,
|
||||
Windows874.INSTANCE,
|
||||
EucKr.INSTANCE,
|
||||
Windows1250.INSTANCE,
|
||||
Windows1251.INSTANCE,
|
||||
Windows1252.INSTANCE,
|
||||
Windows1253.INSTANCE,
|
||||
Windows1254.INSTANCE,
|
||||
Windows1255.INSTANCE,
|
||||
Windows1256.INSTANCE,
|
||||
Windows1257.INSTANCE,
|
||||
Windows1258.INSTANCE,
|
||||
EucJp.INSTANCE,
|
||||
Gbk.INSTANCE,
|
||||
MacCyrillic.INSTANCE,
|
||||
Macintosh.INSTANCE,
|
||||
MacCyrillic.INSTANCE,
|
||||
ShiftJis.INSTANCE,
|
||||
UserDefined.INSTANCE,
|
||||
Big5.INSTANCE,
|
||||
};
|
||||
|
||||
private static final Encoding[] ENCODINGS = {
|
||||
Big5.INSTANCE,
|
||||
EucJp.INSTANCE,
|
||||
EucKr.INSTANCE,
|
||||
Gb18030.INSTANCE,
|
||||
Gbk.INSTANCE,
|
||||
Ibm866.INSTANCE,
|
||||
Iso2022Jp.INSTANCE,
|
||||
Iso10.INSTANCE,
|
||||
Iso13.INSTANCE,
|
||||
Iso14.INSTANCE,
|
||||
Iso15.INSTANCE,
|
||||
Iso16.INSTANCE,
|
||||
Iso2.INSTANCE,
|
||||
Iso3.INSTANCE,
|
||||
Iso4.INSTANCE,
|
||||
Iso5.INSTANCE,
|
||||
Iso6.INSTANCE,
|
||||
Iso7.INSTANCE,
|
||||
Iso8.INSTANCE,
|
||||
Iso8I.INSTANCE,
|
||||
Koi8R.INSTANCE,
|
||||
Koi8U.INSTANCE,
|
||||
Macintosh.INSTANCE,
|
||||
Replacement.INSTANCE,
|
||||
ShiftJis.INSTANCE,
|
||||
Utf16Be.INSTANCE,
|
||||
Utf16Le.INSTANCE,
|
||||
Utf8.INSTANCE,
|
||||
Windows1250.INSTANCE,
|
||||
Windows1251.INSTANCE,
|
||||
Windows1252.INSTANCE,
|
||||
Windows1253.INSTANCE,
|
||||
Windows1254.INSTANCE,
|
||||
Windows1255.INSTANCE,
|
||||
Windows1256.INSTANCE,
|
||||
Windows1257.INSTANCE,
|
||||
Windows1258.INSTANCE,
|
||||
Windows874.INSTANCE,
|
||||
MacCyrillic.INSTANCE,
|
||||
UserDefined.INSTANCE,
|
||||
};
|
||||
|
||||
/**
|
||||
* The big5 encoding.
|
||||
*/
|
||||
public static final Encoding BIG5 = Big5.INSTANCE;
|
||||
|
||||
/**
|
||||
* The euc-jp encoding.
|
||||
*/
|
||||
public static final Encoding EUC_JP = EucJp.INSTANCE;
|
||||
|
||||
/**
|
||||
* The euc-kr encoding.
|
||||
*/
|
||||
public static final Encoding EUC_KR = EucKr.INSTANCE;
|
||||
|
||||
/**
|
||||
* The gb18030 encoding.
|
||||
*/
|
||||
public static final Encoding GB18030 = Gb18030.INSTANCE;
|
||||
|
||||
/**
|
||||
* The gbk encoding.
|
||||
*/
|
||||
public static final Encoding GBK = Gbk.INSTANCE;
|
||||
|
||||
/**
|
||||
* The ibm866 encoding.
|
||||
*/
|
||||
public static final Encoding IBM866 = Ibm866.INSTANCE;
|
||||
|
||||
/**
|
||||
* The iso-2022-jp encoding.
|
||||
*/
|
||||
public static final Encoding ISO_2022_JP = Iso2022Jp.INSTANCE;
|
||||
|
||||
/**
|
||||
* The iso-8859-10 encoding.
|
||||
*/
|
||||
public static final Encoding ISO_8859_10 = Iso10.INSTANCE;
|
||||
|
||||
/**
|
||||
* The iso-8859-13 encoding.
|
||||
*/
|
||||
public static final Encoding ISO_8859_13 = Iso13.INSTANCE;
|
||||
|
||||
/**
|
||||
* The iso-8859-14 encoding.
|
||||
*/
|
||||
public static final Encoding ISO_8859_14 = Iso14.INSTANCE;
|
||||
|
||||
/**
|
||||
* The iso-8859-15 encoding.
|
||||
*/
|
||||
public static final Encoding ISO_8859_15 = Iso15.INSTANCE;
|
||||
|
||||
/**
|
||||
* The iso-8859-16 encoding.
|
||||
*/
|
||||
public static final Encoding ISO_8859_16 = Iso16.INSTANCE;
|
||||
|
||||
/**
|
||||
* The iso-8859-2 encoding.
|
||||
*/
|
||||
public static final Encoding ISO_8859_2 = Iso2.INSTANCE;
|
||||
|
||||
/**
|
||||
* The iso-8859-3 encoding.
|
||||
*/
|
||||
public static final Encoding ISO_8859_3 = Iso3.INSTANCE;
|
||||
|
||||
/**
|
||||
* The iso-8859-4 encoding.
|
||||
*/
|
||||
public static final Encoding ISO_8859_4 = Iso4.INSTANCE;
|
||||
|
||||
/**
|
||||
* The iso-8859-5 encoding.
|
||||
*/
|
||||
public static final Encoding ISO_8859_5 = Iso5.INSTANCE;
|
||||
|
||||
/**
|
||||
* The iso-8859-6 encoding.
|
||||
*/
|
||||
public static final Encoding ISO_8859_6 = Iso6.INSTANCE;
|
||||
|
||||
/**
|
||||
* The iso-8859-7 encoding.
|
||||
*/
|
||||
public static final Encoding ISO_8859_7 = Iso7.INSTANCE;
|
||||
|
||||
/**
|
||||
* The iso-8859-8 encoding.
|
||||
*/
|
||||
public static final Encoding ISO_8859_8 = Iso8.INSTANCE;
|
||||
|
||||
/**
|
||||
* The iso-8859-8-i encoding.
|
||||
*/
|
||||
public static final Encoding ISO_8859_8_I = Iso8I.INSTANCE;
|
||||
|
||||
/**
|
||||
* The koi8-r encoding.
|
||||
*/
|
||||
public static final Encoding KOI8_R = Koi8R.INSTANCE;
|
||||
|
||||
/**
|
||||
* The koi8-u encoding.
|
||||
*/
|
||||
public static final Encoding KOI8_U = Koi8U.INSTANCE;
|
||||
|
||||
/**
|
||||
* The macintosh encoding.
|
||||
*/
|
||||
public static final Encoding MACINTOSH = Macintosh.INSTANCE;
|
||||
|
||||
/**
|
||||
* The replacement encoding.
|
||||
*/
|
||||
public static final Encoding REPLACEMENT = Replacement.INSTANCE;
|
||||
|
||||
/**
|
||||
* The shift_jis encoding.
|
||||
*/
|
||||
public static final Encoding SHIFT_JIS = ShiftJis.INSTANCE;
|
||||
|
||||
/**
|
||||
* The utf-16be encoding.
|
||||
*/
|
||||
public static final Encoding UTF_16BE = Utf16Be.INSTANCE;
|
||||
|
||||
/**
|
||||
* The utf-16le encoding.
|
||||
*/
|
||||
public static final Encoding UTF_16LE = Utf16Le.INSTANCE;
|
||||
|
||||
/**
|
||||
* The utf-8 encoding.
|
||||
*/
|
||||
public static final Encoding UTF_8 = Utf8.INSTANCE;
|
||||
|
||||
/**
|
||||
* The windows-1250 encoding.
|
||||
*/
|
||||
public static final Encoding WINDOWS_1250 = Windows1250.INSTANCE;
|
||||
|
||||
/**
|
||||
* The windows-1251 encoding.
|
||||
*/
|
||||
public static final Encoding WINDOWS_1251 = Windows1251.INSTANCE;
|
||||
|
||||
/**
|
||||
* The windows-1252 encoding.
|
||||
*/
|
||||
public static final Encoding WINDOWS_1252 = Windows1252.INSTANCE;
|
||||
|
||||
/**
|
||||
* The windows-1253 encoding.
|
||||
*/
|
||||
public static final Encoding WINDOWS_1253 = Windows1253.INSTANCE;
|
||||
|
||||
/**
|
||||
* The windows-1254 encoding.
|
||||
*/
|
||||
public static final Encoding WINDOWS_1254 = Windows1254.INSTANCE;
|
||||
|
||||
/**
|
||||
* The windows-1255 encoding.
|
||||
*/
|
||||
public static final Encoding WINDOWS_1255 = Windows1255.INSTANCE;
|
||||
|
||||
/**
|
||||
* The windows-1256 encoding.
|
||||
*/
|
||||
public static final Encoding WINDOWS_1256 = Windows1256.INSTANCE;
|
||||
|
||||
/**
|
||||
* The windows-1257 encoding.
|
||||
*/
|
||||
public static final Encoding WINDOWS_1257 = Windows1257.INSTANCE;
|
||||
|
||||
/**
|
||||
* The windows-1258 encoding.
|
||||
*/
|
||||
public static final Encoding WINDOWS_1258 = Windows1258.INSTANCE;
|
||||
|
||||
/**
|
||||
* The windows-874 encoding.
|
||||
*/
|
||||
public static final Encoding WINDOWS_874 = Windows874.INSTANCE;
|
||||
|
||||
/**
|
||||
* The x-mac-cyrillic encoding.
|
||||
*/
|
||||
public static final Encoding X_MAC_CYRILLIC = MacCyrillic.INSTANCE;
|
||||
|
||||
/**
|
||||
* The x-user-defined encoding.
|
||||
*/
|
||||
public static final Encoding X_USER_DEFINED = UserDefined.INSTANCE;
|
||||
|
||||
|
||||
private static SortedMap<String, Charset> encodings = null;
|
||||
|
||||
protected Encoding(String canonicalName, String[] aliases) {
|
||||
super(canonicalName, aliases);
|
||||
}
|
||||
|
||||
private enum State {
|
||||
HEAD, LABEL, TAIL
|
||||
};
|
||||
|
||||
public static Encoding forName(String label) {
|
||||
if (label == null) {
|
||||
throw new IllegalArgumentException("Label must not be null.");
|
||||
}
|
||||
if (label.length() == 0) {
|
||||
throw new IllegalCharsetNameException(label);
|
||||
}
|
||||
// First try the fast path
|
||||
int index = Arrays.binarySearch(LABELS, label);
|
||||
if (index >= 0) {
|
||||
return ENCODINGS_FOR_LABELS[index];
|
||||
}
|
||||
// Else, slow path
|
||||
StringBuilder sb = new StringBuilder();
|
||||
State state = State.HEAD;
|
||||
for (int i = 0; i < label.length(); i++) {
|
||||
char c = label.charAt(i);
|
||||
if ((c == ' ') || (c == '\n') || (c == '\r') || (c == '\t')
|
||||
|| (c == '\u000C')) {
|
||||
if (state == State.LABEL) {
|
||||
state = State.TAIL;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if ((c >= 'a' && c <= 'z') || (c >= '0' && c <= '9')) {
|
||||
switch (state) {
|
||||
case HEAD:
|
||||
state = State.LABEL;
|
||||
// Fall through
|
||||
case LABEL:
|
||||
sb.append(c);
|
||||
continue;
|
||||
case TAIL:
|
||||
throw new IllegalCharsetNameException(label);
|
||||
}
|
||||
}
|
||||
if (c >= 'A' && c <= 'Z') {
|
||||
c += 0x20;
|
||||
switch (state) {
|
||||
case HEAD:
|
||||
state = State.LABEL;
|
||||
// Fall through
|
||||
case LABEL:
|
||||
sb.append(c);
|
||||
continue;
|
||||
case TAIL:
|
||||
throw new IllegalCharsetNameException(label);
|
||||
}
|
||||
}
|
||||
if ((c == '-') || (c == '+') || (c == '.') || (c == ':')
|
||||
|| (c == '_')) {
|
||||
switch (state) {
|
||||
case LABEL:
|
||||
sb.append(c);
|
||||
continue;
|
||||
case HEAD:
|
||||
case TAIL:
|
||||
throw new IllegalCharsetNameException(label);
|
||||
}
|
||||
}
|
||||
throw new IllegalCharsetNameException(label);
|
||||
}
|
||||
index = Arrays.binarySearch(LABELS, sb.toString());
|
||||
if (index >= 0) {
|
||||
return ENCODINGS_FOR_LABELS[index];
|
||||
}
|
||||
throw new UnsupportedCharsetException(label);
|
||||
}
|
||||
|
||||
public static Encoding forNameNoReplacement(String label) {
|
||||
Encoding encoding = Encoding.forName(label);
|
||||
if (encoding == Encoding.REPLACEMENT) {
|
||||
throw new UnsupportedCharsetException(label);
|
||||
}
|
||||
return encoding;
|
||||
}
|
||||
|
||||
public static boolean isSupported(String label) {
|
||||
try {
|
||||
Encoding.forName(label);
|
||||
} catch (UnsupportedCharsetException e) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public static boolean isSupportedNoReplacement(String label) {
|
||||
try {
|
||||
Encoding.forNameNoReplacement(label);
|
||||
} catch (UnsupportedCharsetException e) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public static SortedMap<String, Charset> availableCharsets() {
|
||||
if (encodings == null) {
|
||||
TreeMap<String, Charset> map = new TreeMap<String, Charset>();
|
||||
for (Encoding encoding : ENCODINGS) {
|
||||
map.put(encoding.name(), encoding);
|
||||
}
|
||||
encodings = Collections.unmodifiableSortedMap(map);
|
||||
}
|
||||
return encodings;
|
||||
}
|
||||
|
||||
public static Encoding defaultCharset() {
|
||||
return WINDOWS_1252;
|
||||
}
|
||||
|
||||
@Override public boolean canEncode() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override public boolean contains(Charset cs) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override public CharsetEncoder newEncoder() {
|
||||
throw new UnsupportedOperationException("Encoder not implemented.");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
/*
|
||||
* Copyright (c) 2013-2015 Mozilla Foundation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* THIS IS A GENERATED FILE. PLEASE DO NOT EDIT.
|
||||
* Instead, please regenerate using generate-encoding-data.py
|
||||
*/
|
||||
|
||||
package nu.validator.encoding;
|
||||
|
||||
import java.nio.charset.Charset;
|
||||
import java.nio.charset.CharsetDecoder;
|
||||
import java.nio.charset.CharsetEncoder;
|
||||
|
||||
class EucJp extends Encoding {
|
||||
|
||||
private static final String[] LABELS = {
|
||||
"cseucpkdfmtjapanese",
|
||||
"euc-jp",
|
||||
"x-euc-jp"
|
||||
};
|
||||
|
||||
private static final String NAME = "euc-jp";
|
||||
|
||||
static final EucJp INSTANCE = new EucJp();
|
||||
|
||||
private EucJp() {
|
||||
super(NAME, LABELS);
|
||||
}
|
||||
|
||||
@Override public CharsetDecoder newDecoder() {
|
||||
return Charset.forName(NAME).newDecoder();
|
||||
}
|
||||
|
||||
@Override public CharsetEncoder newEncoder() {
|
||||
return Charset.forName(NAME).newEncoder();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
/*
|
||||
* Copyright (c) 2013-2015 Mozilla Foundation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* THIS IS A GENERATED FILE. PLEASE DO NOT EDIT.
|
||||
* Instead, please regenerate using generate-encoding-data.py
|
||||
*/
|
||||
|
||||
package nu.validator.encoding;
|
||||
|
||||
import java.nio.charset.Charset;
|
||||
import java.nio.charset.CharsetDecoder;
|
||||
import java.nio.charset.CharsetEncoder;
|
||||
|
||||
class EucKr extends Encoding {
|
||||
|
||||
private static final String[] LABELS = {
|
||||
"cseuckr",
|
||||
"csksc56011987",
|
||||
"euc-kr",
|
||||
"iso-ir-149",
|
||||
"korean",
|
||||
"ks_c_5601-1987",
|
||||
"ks_c_5601-1989",
|
||||
"ksc5601",
|
||||
"ksc_5601",
|
||||
"windows-949"
|
||||
};
|
||||
|
||||
private static final String NAME = "euc-kr";
|
||||
|
||||
static final EucKr INSTANCE = new EucKr();
|
||||
|
||||
private EucKr() {
|
||||
super(NAME, LABELS);
|
||||
}
|
||||
|
||||
@Override public CharsetDecoder newDecoder() {
|
||||
return Charset.forName(NAME).newDecoder();
|
||||
}
|
||||
|
||||
@Override public CharsetEncoder newEncoder() {
|
||||
return Charset.forName(NAME).newEncoder();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
/*
|
||||
* Copyright (c) 2013-2015 Mozilla Foundation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package nu.validator.encoding;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.CharBuffer;
|
||||
import java.nio.charset.CoderResult;
|
||||
|
||||
public final class FallibleSingleByteDecoder extends InfallibleSingleByteDecoder {
|
||||
|
||||
public FallibleSingleByteDecoder(Encoding cs, char[] upperHalf) {
|
||||
super(cs, upperHalf);
|
||||
}
|
||||
|
||||
@Override protected CoderResult decodeLoop(ByteBuffer in, CharBuffer out) {
|
||||
if (!this.report) {
|
||||
return super.decodeLoop(in, out);
|
||||
} else {
|
||||
for (;;) {
|
||||
if (!in.hasRemaining()) {
|
||||
return CoderResult.UNDERFLOW;
|
||||
}
|
||||
if (!out.hasRemaining()) {
|
||||
return CoderResult.OVERFLOW;
|
||||
}
|
||||
int b = (int) in.get();
|
||||
if (b >= 0) {
|
||||
out.put((char) b);
|
||||
} else {
|
||||
char mapped = this.upperHalf[b + 128];
|
||||
if (mapped == '\uFFFD') {
|
||||
in.position(in.position() - 1);
|
||||
return CoderResult.malformedForLength(1);
|
||||
}
|
||||
out.put(mapped);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
/*
|
||||
* Copyright (c) 2013-2015 Mozilla Foundation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* THIS IS A GENERATED FILE. PLEASE DO NOT EDIT.
|
||||
* Instead, please regenerate using generate-encoding-data.py
|
||||
*/
|
||||
|
||||
package nu.validator.encoding;
|
||||
|
||||
import java.nio.charset.Charset;
|
||||
import java.nio.charset.CharsetDecoder;
|
||||
import java.nio.charset.CharsetEncoder;
|
||||
|
||||
class Gb18030 extends Encoding {
|
||||
|
||||
private static final String[] LABELS = {
|
||||
"gb18030"
|
||||
};
|
||||
|
||||
private static final String NAME = "gb18030";
|
||||
|
||||
static final Gb18030 INSTANCE = new Gb18030();
|
||||
|
||||
private Gb18030() {
|
||||
super(NAME, LABELS);
|
||||
}
|
||||
|
||||
@Override public CharsetDecoder newDecoder() {
|
||||
return Charset.forName(NAME).newDecoder();
|
||||
}
|
||||
|
||||
@Override public CharsetEncoder newEncoder() {
|
||||
return Charset.forName(NAME).newEncoder();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
/*
|
||||
* Copyright (c) 2013-2015 Mozilla Foundation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* THIS IS A GENERATED FILE. PLEASE DO NOT EDIT.
|
||||
* Instead, please regenerate using generate-encoding-data.py
|
||||
*/
|
||||
|
||||
package nu.validator.encoding;
|
||||
|
||||
import java.nio.charset.Charset;
|
||||
import java.nio.charset.CharsetDecoder;
|
||||
import java.nio.charset.CharsetEncoder;
|
||||
|
||||
class Gbk extends Encoding {
|
||||
|
||||
private static final String[] LABELS = {
|
||||
"chinese",
|
||||
"csgb2312",
|
||||
"csiso58gb231280",
|
||||
"gb2312",
|
||||
"gb_2312",
|
||||
"gb_2312-80",
|
||||
"gbk",
|
||||
"iso-ir-58",
|
||||
"x-gbk"
|
||||
};
|
||||
|
||||
private static final String NAME = "gbk";
|
||||
|
||||
static final Gbk INSTANCE = new Gbk();
|
||||
|
||||
private Gbk() {
|
||||
super(NAME, LABELS);
|
||||
}
|
||||
|
||||
@Override public CharsetDecoder newDecoder() {
|
||||
return Charset.forName("gb18030").newDecoder();
|
||||
}
|
||||
|
||||
@Override public CharsetEncoder newEncoder() {
|
||||
return Charset.forName(NAME).newEncoder();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,184 @@
|
||||
/*
|
||||
* Copyright (c) 2013-2015 Mozilla Foundation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* THIS IS A GENERATED FILE. PLEASE DO NOT EDIT.
|
||||
* Instead, please regenerate using generate-encoding-data.py
|
||||
*/
|
||||
|
||||
package nu.validator.encoding;
|
||||
|
||||
import java.nio.charset.CharsetDecoder;
|
||||
|
||||
class Ibm866 extends Encoding {
|
||||
|
||||
private static final char[] TABLE = {
|
||||
'\u0410',
|
||||
'\u0411',
|
||||
'\u0412',
|
||||
'\u0413',
|
||||
'\u0414',
|
||||
'\u0415',
|
||||
'\u0416',
|
||||
'\u0417',
|
||||
'\u0418',
|
||||
'\u0419',
|
||||
'\u041a',
|
||||
'\u041b',
|
||||
'\u041c',
|
||||
'\u041d',
|
||||
'\u041e',
|
||||
'\u041f',
|
||||
'\u0420',
|
||||
'\u0421',
|
||||
'\u0422',
|
||||
'\u0423',
|
||||
'\u0424',
|
||||
'\u0425',
|
||||
'\u0426',
|
||||
'\u0427',
|
||||
'\u0428',
|
||||
'\u0429',
|
||||
'\u042a',
|
||||
'\u042b',
|
||||
'\u042c',
|
||||
'\u042d',
|
||||
'\u042e',
|
||||
'\u042f',
|
||||
'\u0430',
|
||||
'\u0431',
|
||||
'\u0432',
|
||||
'\u0433',
|
||||
'\u0434',
|
||||
'\u0435',
|
||||
'\u0436',
|
||||
'\u0437',
|
||||
'\u0438',
|
||||
'\u0439',
|
||||
'\u043a',
|
||||
'\u043b',
|
||||
'\u043c',
|
||||
'\u043d',
|
||||
'\u043e',
|
||||
'\u043f',
|
||||
'\u2591',
|
||||
'\u2592',
|
||||
'\u2593',
|
||||
'\u2502',
|
||||
'\u2524',
|
||||
'\u2561',
|
||||
'\u2562',
|
||||
'\u2556',
|
||||
'\u2555',
|
||||
'\u2563',
|
||||
'\u2551',
|
||||
'\u2557',
|
||||
'\u255d',
|
||||
'\u255c',
|
||||
'\u255b',
|
||||
'\u2510',
|
||||
'\u2514',
|
||||
'\u2534',
|
||||
'\u252c',
|
||||
'\u251c',
|
||||
'\u2500',
|
||||
'\u253c',
|
||||
'\u255e',
|
||||
'\u255f',
|
||||
'\u255a',
|
||||
'\u2554',
|
||||
'\u2569',
|
||||
'\u2566',
|
||||
'\u2560',
|
||||
'\u2550',
|
||||
'\u256c',
|
||||
'\u2567',
|
||||
'\u2568',
|
||||
'\u2564',
|
||||
'\u2565',
|
||||
'\u2559',
|
||||
'\u2558',
|
||||
'\u2552',
|
||||
'\u2553',
|
||||
'\u256b',
|
||||
'\u256a',
|
||||
'\u2518',
|
||||
'\u250c',
|
||||
'\u2588',
|
||||
'\u2584',
|
||||
'\u258c',
|
||||
'\u2590',
|
||||
'\u2580',
|
||||
'\u0440',
|
||||
'\u0441',
|
||||
'\u0442',
|
||||
'\u0443',
|
||||
'\u0444',
|
||||
'\u0445',
|
||||
'\u0446',
|
||||
'\u0447',
|
||||
'\u0448',
|
||||
'\u0449',
|
||||
'\u044a',
|
||||
'\u044b',
|
||||
'\u044c',
|
||||
'\u044d',
|
||||
'\u044e',
|
||||
'\u044f',
|
||||
'\u0401',
|
||||
'\u0451',
|
||||
'\u0404',
|
||||
'\u0454',
|
||||
'\u0407',
|
||||
'\u0457',
|
||||
'\u040e',
|
||||
'\u045e',
|
||||
'\u00b0',
|
||||
'\u2219',
|
||||
'\u00b7',
|
||||
'\u221a',
|
||||
'\u2116',
|
||||
'\u00a4',
|
||||
'\u25a0',
|
||||
'\u00a0'
|
||||
};
|
||||
|
||||
private static final String[] LABELS = {
|
||||
"866",
|
||||
"cp866",
|
||||
"csibm866",
|
||||
"ibm866"
|
||||
};
|
||||
|
||||
private static final String NAME = "ibm866";
|
||||
|
||||
static final Encoding INSTANCE = new Ibm866();
|
||||
|
||||
private Ibm866() {
|
||||
super(NAME, LABELS);
|
||||
}
|
||||
|
||||
@Override public CharsetDecoder newDecoder() {
|
||||
return new InfallibleSingleByteDecoder(this, TABLE);
|
||||
}
|
||||
|
||||
}
|
||||
+57
@@ -0,0 +1,57 @@
|
||||
/*
|
||||
* Copyright (c) 2013-2015 Mozilla Foundation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package nu.validator.encoding;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.CharBuffer;
|
||||
import java.nio.charset.CoderResult;
|
||||
|
||||
public class InfallibleSingleByteDecoder extends Decoder {
|
||||
|
||||
protected final char[] upperHalf;
|
||||
|
||||
protected InfallibleSingleByteDecoder(Encoding cs, char[] upperHalf) {
|
||||
super(cs, 1.0f, 1.0f);
|
||||
this.upperHalf = upperHalf;
|
||||
}
|
||||
|
||||
@Override protected CoderResult decodeLoop(ByteBuffer in, CharBuffer out) {
|
||||
// TODO figure out if it's worthwhile to optimize the case where both
|
||||
// buffers are array-backed.
|
||||
for (;;) {
|
||||
if (!in.hasRemaining()) {
|
||||
return CoderResult.UNDERFLOW;
|
||||
}
|
||||
if (!out.hasRemaining()) {
|
||||
return CoderResult.OVERFLOW;
|
||||
}
|
||||
int b = (int) in.get();
|
||||
if (b >= 0) {
|
||||
out.put((char) b);
|
||||
} else {
|
||||
out.put(this.upperHalf[b + 128]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,187 @@
|
||||
/*
|
||||
* Copyright (c) 2013-2015 Mozilla Foundation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* THIS IS A GENERATED FILE. PLEASE DO NOT EDIT.
|
||||
* Instead, please regenerate using generate-encoding-data.py
|
||||
*/
|
||||
|
||||
package nu.validator.encoding;
|
||||
|
||||
import java.nio.charset.CharsetDecoder;
|
||||
|
||||
class Iso10 extends Encoding {
|
||||
|
||||
private static final char[] TABLE = {
|
||||
'\u0080',
|
||||
'\u0081',
|
||||
'\u0082',
|
||||
'\u0083',
|
||||
'\u0084',
|
||||
'\u0085',
|
||||
'\u0086',
|
||||
'\u0087',
|
||||
'\u0088',
|
||||
'\u0089',
|
||||
'\u008a',
|
||||
'\u008b',
|
||||
'\u008c',
|
||||
'\u008d',
|
||||
'\u008e',
|
||||
'\u008f',
|
||||
'\u0090',
|
||||
'\u0091',
|
||||
'\u0092',
|
||||
'\u0093',
|
||||
'\u0094',
|
||||
'\u0095',
|
||||
'\u0096',
|
||||
'\u0097',
|
||||
'\u0098',
|
||||
'\u0099',
|
||||
'\u009a',
|
||||
'\u009b',
|
||||
'\u009c',
|
||||
'\u009d',
|
||||
'\u009e',
|
||||
'\u009f',
|
||||
'\u00a0',
|
||||
'\u0104',
|
||||
'\u0112',
|
||||
'\u0122',
|
||||
'\u012a',
|
||||
'\u0128',
|
||||
'\u0136',
|
||||
'\u00a7',
|
||||
'\u013b',
|
||||
'\u0110',
|
||||
'\u0160',
|
||||
'\u0166',
|
||||
'\u017d',
|
||||
'\u00ad',
|
||||
'\u016a',
|
||||
'\u014a',
|
||||
'\u00b0',
|
||||
'\u0105',
|
||||
'\u0113',
|
||||
'\u0123',
|
||||
'\u012b',
|
||||
'\u0129',
|
||||
'\u0137',
|
||||
'\u00b7',
|
||||
'\u013c',
|
||||
'\u0111',
|
||||
'\u0161',
|
||||
'\u0167',
|
||||
'\u017e',
|
||||
'\u2015',
|
||||
'\u016b',
|
||||
'\u014b',
|
||||
'\u0100',
|
||||
'\u00c1',
|
||||
'\u00c2',
|
||||
'\u00c3',
|
||||
'\u00c4',
|
||||
'\u00c5',
|
||||
'\u00c6',
|
||||
'\u012e',
|
||||
'\u010c',
|
||||
'\u00c9',
|
||||
'\u0118',
|
||||
'\u00cb',
|
||||
'\u0116',
|
||||
'\u00cd',
|
||||
'\u00ce',
|
||||
'\u00cf',
|
||||
'\u00d0',
|
||||
'\u0145',
|
||||
'\u014c',
|
||||
'\u00d3',
|
||||
'\u00d4',
|
||||
'\u00d5',
|
||||
'\u00d6',
|
||||
'\u0168',
|
||||
'\u00d8',
|
||||
'\u0172',
|
||||
'\u00da',
|
||||
'\u00db',
|
||||
'\u00dc',
|
||||
'\u00dd',
|
||||
'\u00de',
|
||||
'\u00df',
|
||||
'\u0101',
|
||||
'\u00e1',
|
||||
'\u00e2',
|
||||
'\u00e3',
|
||||
'\u00e4',
|
||||
'\u00e5',
|
||||
'\u00e6',
|
||||
'\u012f',
|
||||
'\u010d',
|
||||
'\u00e9',
|
||||
'\u0119',
|
||||
'\u00eb',
|
||||
'\u0117',
|
||||
'\u00ed',
|
||||
'\u00ee',
|
||||
'\u00ef',
|
||||
'\u00f0',
|
||||
'\u0146',
|
||||
'\u014d',
|
||||
'\u00f3',
|
||||
'\u00f4',
|
||||
'\u00f5',
|
||||
'\u00f6',
|
||||
'\u0169',
|
||||
'\u00f8',
|
||||
'\u0173',
|
||||
'\u00fa',
|
||||
'\u00fb',
|
||||
'\u00fc',
|
||||
'\u00fd',
|
||||
'\u00fe',
|
||||
'\u0138'
|
||||
};
|
||||
|
||||
private static final String[] LABELS = {
|
||||
"csisolatin6",
|
||||
"iso-8859-10",
|
||||
"iso-ir-157",
|
||||
"iso8859-10",
|
||||
"iso885910",
|
||||
"l6",
|
||||
"latin6"
|
||||
};
|
||||
|
||||
private static final String NAME = "iso-8859-10";
|
||||
|
||||
static final Encoding INSTANCE = new Iso10();
|
||||
|
||||
private Iso10() {
|
||||
super(NAME, LABELS);
|
||||
}
|
||||
|
||||
@Override public CharsetDecoder newDecoder() {
|
||||
return new InfallibleSingleByteDecoder(this, TABLE);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,183 @@
|
||||
/*
|
||||
* Copyright (c) 2013-2015 Mozilla Foundation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* THIS IS A GENERATED FILE. PLEASE DO NOT EDIT.
|
||||
* Instead, please regenerate using generate-encoding-data.py
|
||||
*/
|
||||
|
||||
package nu.validator.encoding;
|
||||
|
||||
import java.nio.charset.CharsetDecoder;
|
||||
|
||||
class Iso13 extends Encoding {
|
||||
|
||||
private static final char[] TABLE = {
|
||||
'\u0080',
|
||||
'\u0081',
|
||||
'\u0082',
|
||||
'\u0083',
|
||||
'\u0084',
|
||||
'\u0085',
|
||||
'\u0086',
|
||||
'\u0087',
|
||||
'\u0088',
|
||||
'\u0089',
|
||||
'\u008a',
|
||||
'\u008b',
|
||||
'\u008c',
|
||||
'\u008d',
|
||||
'\u008e',
|
||||
'\u008f',
|
||||
'\u0090',
|
||||
'\u0091',
|
||||
'\u0092',
|
||||
'\u0093',
|
||||
'\u0094',
|
||||
'\u0095',
|
||||
'\u0096',
|
||||
'\u0097',
|
||||
'\u0098',
|
||||
'\u0099',
|
||||
'\u009a',
|
||||
'\u009b',
|
||||
'\u009c',
|
||||
'\u009d',
|
||||
'\u009e',
|
||||
'\u009f',
|
||||
'\u00a0',
|
||||
'\u201d',
|
||||
'\u00a2',
|
||||
'\u00a3',
|
||||
'\u00a4',
|
||||
'\u201e',
|
||||
'\u00a6',
|
||||
'\u00a7',
|
||||
'\u00d8',
|
||||
'\u00a9',
|
||||
'\u0156',
|
||||
'\u00ab',
|
||||
'\u00ac',
|
||||
'\u00ad',
|
||||
'\u00ae',
|
||||
'\u00c6',
|
||||
'\u00b0',
|
||||
'\u00b1',
|
||||
'\u00b2',
|
||||
'\u00b3',
|
||||
'\u201c',
|
||||
'\u00b5',
|
||||
'\u00b6',
|
||||
'\u00b7',
|
||||
'\u00f8',
|
||||
'\u00b9',
|
||||
'\u0157',
|
||||
'\u00bb',
|
||||
'\u00bc',
|
||||
'\u00bd',
|
||||
'\u00be',
|
||||
'\u00e6',
|
||||
'\u0104',
|
||||
'\u012e',
|
||||
'\u0100',
|
||||
'\u0106',
|
||||
'\u00c4',
|
||||
'\u00c5',
|
||||
'\u0118',
|
||||
'\u0112',
|
||||
'\u010c',
|
||||
'\u00c9',
|
||||
'\u0179',
|
||||
'\u0116',
|
||||
'\u0122',
|
||||
'\u0136',
|
||||
'\u012a',
|
||||
'\u013b',
|
||||
'\u0160',
|
||||
'\u0143',
|
||||
'\u0145',
|
||||
'\u00d3',
|
||||
'\u014c',
|
||||
'\u00d5',
|
||||
'\u00d6',
|
||||
'\u00d7',
|
||||
'\u0172',
|
||||
'\u0141',
|
||||
'\u015a',
|
||||
'\u016a',
|
||||
'\u00dc',
|
||||
'\u017b',
|
||||
'\u017d',
|
||||
'\u00df',
|
||||
'\u0105',
|
||||
'\u012f',
|
||||
'\u0101',
|
||||
'\u0107',
|
||||
'\u00e4',
|
||||
'\u00e5',
|
||||
'\u0119',
|
||||
'\u0113',
|
||||
'\u010d',
|
||||
'\u00e9',
|
||||
'\u017a',
|
||||
'\u0117',
|
||||
'\u0123',
|
||||
'\u0137',
|
||||
'\u012b',
|
||||
'\u013c',
|
||||
'\u0161',
|
||||
'\u0144',
|
||||
'\u0146',
|
||||
'\u00f3',
|
||||
'\u014d',
|
||||
'\u00f5',
|
||||
'\u00f6',
|
||||
'\u00f7',
|
||||
'\u0173',
|
||||
'\u0142',
|
||||
'\u015b',
|
||||
'\u016b',
|
||||
'\u00fc',
|
||||
'\u017c',
|
||||
'\u017e',
|
||||
'\u2019'
|
||||
};
|
||||
|
||||
private static final String[] LABELS = {
|
||||
"iso-8859-13",
|
||||
"iso8859-13",
|
||||
"iso885913"
|
||||
};
|
||||
|
||||
private static final String NAME = "iso-8859-13";
|
||||
|
||||
static final Encoding INSTANCE = new Iso13();
|
||||
|
||||
private Iso13() {
|
||||
super(NAME, LABELS);
|
||||
}
|
||||
|
||||
@Override public CharsetDecoder newDecoder() {
|
||||
return new InfallibleSingleByteDecoder(this, TABLE);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,183 @@
|
||||
/*
|
||||
* Copyright (c) 2013-2015 Mozilla Foundation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* THIS IS A GENERATED FILE. PLEASE DO NOT EDIT.
|
||||
* Instead, please regenerate using generate-encoding-data.py
|
||||
*/
|
||||
|
||||
package nu.validator.encoding;
|
||||
|
||||
import java.nio.charset.CharsetDecoder;
|
||||
|
||||
class Iso14 extends Encoding {
|
||||
|
||||
private static final char[] TABLE = {
|
||||
'\u0080',
|
||||
'\u0081',
|
||||
'\u0082',
|
||||
'\u0083',
|
||||
'\u0084',
|
||||
'\u0085',
|
||||
'\u0086',
|
||||
'\u0087',
|
||||
'\u0088',
|
||||
'\u0089',
|
||||
'\u008a',
|
||||
'\u008b',
|
||||
'\u008c',
|
||||
'\u008d',
|
||||
'\u008e',
|
||||
'\u008f',
|
||||
'\u0090',
|
||||
'\u0091',
|
||||
'\u0092',
|
||||
'\u0093',
|
||||
'\u0094',
|
||||
'\u0095',
|
||||
'\u0096',
|
||||
'\u0097',
|
||||
'\u0098',
|
||||
'\u0099',
|
||||
'\u009a',
|
||||
'\u009b',
|
||||
'\u009c',
|
||||
'\u009d',
|
||||
'\u009e',
|
||||
'\u009f',
|
||||
'\u00a0',
|
||||
'\u1e02',
|
||||
'\u1e03',
|
||||
'\u00a3',
|
||||
'\u010a',
|
||||
'\u010b',
|
||||
'\u1e0a',
|
||||
'\u00a7',
|
||||
'\u1e80',
|
||||
'\u00a9',
|
||||
'\u1e82',
|
||||
'\u1e0b',
|
||||
'\u1ef2',
|
||||
'\u00ad',
|
||||
'\u00ae',
|
||||
'\u0178',
|
||||
'\u1e1e',
|
||||
'\u1e1f',
|
||||
'\u0120',
|
||||
'\u0121',
|
||||
'\u1e40',
|
||||
'\u1e41',
|
||||
'\u00b6',
|
||||
'\u1e56',
|
||||
'\u1e81',
|
||||
'\u1e57',
|
||||
'\u1e83',
|
||||
'\u1e60',
|
||||
'\u1ef3',
|
||||
'\u1e84',
|
||||
'\u1e85',
|
||||
'\u1e61',
|
||||
'\u00c0',
|
||||
'\u00c1',
|
||||
'\u00c2',
|
||||
'\u00c3',
|
||||
'\u00c4',
|
||||
'\u00c5',
|
||||
'\u00c6',
|
||||
'\u00c7',
|
||||
'\u00c8',
|
||||
'\u00c9',
|
||||
'\u00ca',
|
||||
'\u00cb',
|
||||
'\u00cc',
|
||||
'\u00cd',
|
||||
'\u00ce',
|
||||
'\u00cf',
|
||||
'\u0174',
|
||||
'\u00d1',
|
||||
'\u00d2',
|
||||
'\u00d3',
|
||||
'\u00d4',
|
||||
'\u00d5',
|
||||
'\u00d6',
|
||||
'\u1e6a',
|
||||
'\u00d8',
|
||||
'\u00d9',
|
||||
'\u00da',
|
||||
'\u00db',
|
||||
'\u00dc',
|
||||
'\u00dd',
|
||||
'\u0176',
|
||||
'\u00df',
|
||||
'\u00e0',
|
||||
'\u00e1',
|
||||
'\u00e2',
|
||||
'\u00e3',
|
||||
'\u00e4',
|
||||
'\u00e5',
|
||||
'\u00e6',
|
||||
'\u00e7',
|
||||
'\u00e8',
|
||||
'\u00e9',
|
||||
'\u00ea',
|
||||
'\u00eb',
|
||||
'\u00ec',
|
||||
'\u00ed',
|
||||
'\u00ee',
|
||||
'\u00ef',
|
||||
'\u0175',
|
||||
'\u00f1',
|
||||
'\u00f2',
|
||||
'\u00f3',
|
||||
'\u00f4',
|
||||
'\u00f5',
|
||||
'\u00f6',
|
||||
'\u1e6b',
|
||||
'\u00f8',
|
||||
'\u00f9',
|
||||
'\u00fa',
|
||||
'\u00fb',
|
||||
'\u00fc',
|
||||
'\u00fd',
|
||||
'\u0177',
|
||||
'\u00ff'
|
||||
};
|
||||
|
||||
private static final String[] LABELS = {
|
||||
"iso-8859-14",
|
||||
"iso8859-14",
|
||||
"iso885914"
|
||||
};
|
||||
|
||||
private static final String NAME = "iso-8859-14";
|
||||
|
||||
static final Encoding INSTANCE = new Iso14();
|
||||
|
||||
private Iso14() {
|
||||
super(NAME, LABELS);
|
||||
}
|
||||
|
||||
@Override public CharsetDecoder newDecoder() {
|
||||
return new InfallibleSingleByteDecoder(this, TABLE);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,186 @@
|
||||
/*
|
||||
* Copyright (c) 2013-2015 Mozilla Foundation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* THIS IS A GENERATED FILE. PLEASE DO NOT EDIT.
|
||||
* Instead, please regenerate using generate-encoding-data.py
|
||||
*/
|
||||
|
||||
package nu.validator.encoding;
|
||||
|
||||
import java.nio.charset.CharsetDecoder;
|
||||
|
||||
class Iso15 extends Encoding {
|
||||
|
||||
private static final char[] TABLE = {
|
||||
'\u0080',
|
||||
'\u0081',
|
||||
'\u0082',
|
||||
'\u0083',
|
||||
'\u0084',
|
||||
'\u0085',
|
||||
'\u0086',
|
||||
'\u0087',
|
||||
'\u0088',
|
||||
'\u0089',
|
||||
'\u008a',
|
||||
'\u008b',
|
||||
'\u008c',
|
||||
'\u008d',
|
||||
'\u008e',
|
||||
'\u008f',
|
||||
'\u0090',
|
||||
'\u0091',
|
||||
'\u0092',
|
||||
'\u0093',
|
||||
'\u0094',
|
||||
'\u0095',
|
||||
'\u0096',
|
||||
'\u0097',
|
||||
'\u0098',
|
||||
'\u0099',
|
||||
'\u009a',
|
||||
'\u009b',
|
||||
'\u009c',
|
||||
'\u009d',
|
||||
'\u009e',
|
||||
'\u009f',
|
||||
'\u00a0',
|
||||
'\u00a1',
|
||||
'\u00a2',
|
||||
'\u00a3',
|
||||
'\u20ac',
|
||||
'\u00a5',
|
||||
'\u0160',
|
||||
'\u00a7',
|
||||
'\u0161',
|
||||
'\u00a9',
|
||||
'\u00aa',
|
||||
'\u00ab',
|
||||
'\u00ac',
|
||||
'\u00ad',
|
||||
'\u00ae',
|
||||
'\u00af',
|
||||
'\u00b0',
|
||||
'\u00b1',
|
||||
'\u00b2',
|
||||
'\u00b3',
|
||||
'\u017d',
|
||||
'\u00b5',
|
||||
'\u00b6',
|
||||
'\u00b7',
|
||||
'\u017e',
|
||||
'\u00b9',
|
||||
'\u00ba',
|
||||
'\u00bb',
|
||||
'\u0152',
|
||||
'\u0153',
|
||||
'\u0178',
|
||||
'\u00bf',
|
||||
'\u00c0',
|
||||
'\u00c1',
|
||||
'\u00c2',
|
||||
'\u00c3',
|
||||
'\u00c4',
|
||||
'\u00c5',
|
||||
'\u00c6',
|
||||
'\u00c7',
|
||||
'\u00c8',
|
||||
'\u00c9',
|
||||
'\u00ca',
|
||||
'\u00cb',
|
||||
'\u00cc',
|
||||
'\u00cd',
|
||||
'\u00ce',
|
||||
'\u00cf',
|
||||
'\u00d0',
|
||||
'\u00d1',
|
||||
'\u00d2',
|
||||
'\u00d3',
|
||||
'\u00d4',
|
||||
'\u00d5',
|
||||
'\u00d6',
|
||||
'\u00d7',
|
||||
'\u00d8',
|
||||
'\u00d9',
|
||||
'\u00da',
|
||||
'\u00db',
|
||||
'\u00dc',
|
||||
'\u00dd',
|
||||
'\u00de',
|
||||
'\u00df',
|
||||
'\u00e0',
|
||||
'\u00e1',
|
||||
'\u00e2',
|
||||
'\u00e3',
|
||||
'\u00e4',
|
||||
'\u00e5',
|
||||
'\u00e6',
|
||||
'\u00e7',
|
||||
'\u00e8',
|
||||
'\u00e9',
|
||||
'\u00ea',
|
||||
'\u00eb',
|
||||
'\u00ec',
|
||||
'\u00ed',
|
||||
'\u00ee',
|
||||
'\u00ef',
|
||||
'\u00f0',
|
||||
'\u00f1',
|
||||
'\u00f2',
|
||||
'\u00f3',
|
||||
'\u00f4',
|
||||
'\u00f5',
|
||||
'\u00f6',
|
||||
'\u00f7',
|
||||
'\u00f8',
|
||||
'\u00f9',
|
||||
'\u00fa',
|
||||
'\u00fb',
|
||||
'\u00fc',
|
||||
'\u00fd',
|
||||
'\u00fe',
|
||||
'\u00ff'
|
||||
};
|
||||
|
||||
private static final String[] LABELS = {
|
||||
"csisolatin9",
|
||||
"iso-8859-15",
|
||||
"iso8859-15",
|
||||
"iso885915",
|
||||
"iso_8859-15",
|
||||
"l9"
|
||||
};
|
||||
|
||||
private static final String NAME = "iso-8859-15";
|
||||
|
||||
static final Encoding INSTANCE = new Iso15();
|
||||
|
||||
private Iso15() {
|
||||
super(NAME, LABELS);
|
||||
}
|
||||
|
||||
@Override public CharsetDecoder newDecoder() {
|
||||
return new InfallibleSingleByteDecoder(this, TABLE);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,181 @@
|
||||
/*
|
||||
* Copyright (c) 2013-2015 Mozilla Foundation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* THIS IS A GENERATED FILE. PLEASE DO NOT EDIT.
|
||||
* Instead, please regenerate using generate-encoding-data.py
|
||||
*/
|
||||
|
||||
package nu.validator.encoding;
|
||||
|
||||
import java.nio.charset.CharsetDecoder;
|
||||
|
||||
class Iso16 extends Encoding {
|
||||
|
||||
private static final char[] TABLE = {
|
||||
'\u0080',
|
||||
'\u0081',
|
||||
'\u0082',
|
||||
'\u0083',
|
||||
'\u0084',
|
||||
'\u0085',
|
||||
'\u0086',
|
||||
'\u0087',
|
||||
'\u0088',
|
||||
'\u0089',
|
||||
'\u008a',
|
||||
'\u008b',
|
||||
'\u008c',
|
||||
'\u008d',
|
||||
'\u008e',
|
||||
'\u008f',
|
||||
'\u0090',
|
||||
'\u0091',
|
||||
'\u0092',
|
||||
'\u0093',
|
||||
'\u0094',
|
||||
'\u0095',
|
||||
'\u0096',
|
||||
'\u0097',
|
||||
'\u0098',
|
||||
'\u0099',
|
||||
'\u009a',
|
||||
'\u009b',
|
||||
'\u009c',
|
||||
'\u009d',
|
||||
'\u009e',
|
||||
'\u009f',
|
||||
'\u00a0',
|
||||
'\u0104',
|
||||
'\u0105',
|
||||
'\u0141',
|
||||
'\u20ac',
|
||||
'\u201e',
|
||||
'\u0160',
|
||||
'\u00a7',
|
||||
'\u0161',
|
||||
'\u00a9',
|
||||
'\u0218',
|
||||
'\u00ab',
|
||||
'\u0179',
|
||||
'\u00ad',
|
||||
'\u017a',
|
||||
'\u017b',
|
||||
'\u00b0',
|
||||
'\u00b1',
|
||||
'\u010c',
|
||||
'\u0142',
|
||||
'\u017d',
|
||||
'\u201d',
|
||||
'\u00b6',
|
||||
'\u00b7',
|
||||
'\u017e',
|
||||
'\u010d',
|
||||
'\u0219',
|
||||
'\u00bb',
|
||||
'\u0152',
|
||||
'\u0153',
|
||||
'\u0178',
|
||||
'\u017c',
|
||||
'\u00c0',
|
||||
'\u00c1',
|
||||
'\u00c2',
|
||||
'\u0102',
|
||||
'\u00c4',
|
||||
'\u0106',
|
||||
'\u00c6',
|
||||
'\u00c7',
|
||||
'\u00c8',
|
||||
'\u00c9',
|
||||
'\u00ca',
|
||||
'\u00cb',
|
||||
'\u00cc',
|
||||
'\u00cd',
|
||||
'\u00ce',
|
||||
'\u00cf',
|
||||
'\u0110',
|
||||
'\u0143',
|
||||
'\u00d2',
|
||||
'\u00d3',
|
||||
'\u00d4',
|
||||
'\u0150',
|
||||
'\u00d6',
|
||||
'\u015a',
|
||||
'\u0170',
|
||||
'\u00d9',
|
||||
'\u00da',
|
||||
'\u00db',
|
||||
'\u00dc',
|
||||
'\u0118',
|
||||
'\u021a',
|
||||
'\u00df',
|
||||
'\u00e0',
|
||||
'\u00e1',
|
||||
'\u00e2',
|
||||
'\u0103',
|
||||
'\u00e4',
|
||||
'\u0107',
|
||||
'\u00e6',
|
||||
'\u00e7',
|
||||
'\u00e8',
|
||||
'\u00e9',
|
||||
'\u00ea',
|
||||
'\u00eb',
|
||||
'\u00ec',
|
||||
'\u00ed',
|
||||
'\u00ee',
|
||||
'\u00ef',
|
||||
'\u0111',
|
||||
'\u0144',
|
||||
'\u00f2',
|
||||
'\u00f3',
|
||||
'\u00f4',
|
||||
'\u0151',
|
||||
'\u00f6',
|
||||
'\u015b',
|
||||
'\u0171',
|
||||
'\u00f9',
|
||||
'\u00fa',
|
||||
'\u00fb',
|
||||
'\u00fc',
|
||||
'\u0119',
|
||||
'\u021b',
|
||||
'\u00ff'
|
||||
};
|
||||
|
||||
private static final String[] LABELS = {
|
||||
"iso-8859-16"
|
||||
};
|
||||
|
||||
private static final String NAME = "iso-8859-16";
|
||||
|
||||
static final Encoding INSTANCE = new Iso16();
|
||||
|
||||
private Iso16() {
|
||||
super(NAME, LABELS);
|
||||
}
|
||||
|
||||
@Override public CharsetDecoder newDecoder() {
|
||||
return new InfallibleSingleByteDecoder(this, TABLE);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,189 @@
|
||||
/*
|
||||
* Copyright (c) 2013-2015 Mozilla Foundation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* THIS IS A GENERATED FILE. PLEASE DO NOT EDIT.
|
||||
* Instead, please regenerate using generate-encoding-data.py
|
||||
*/
|
||||
|
||||
package nu.validator.encoding;
|
||||
|
||||
import java.nio.charset.CharsetDecoder;
|
||||
|
||||
class Iso2 extends Encoding {
|
||||
|
||||
private static final char[] TABLE = {
|
||||
'\u0080',
|
||||
'\u0081',
|
||||
'\u0082',
|
||||
'\u0083',
|
||||
'\u0084',
|
||||
'\u0085',
|
||||
'\u0086',
|
||||
'\u0087',
|
||||
'\u0088',
|
||||
'\u0089',
|
||||
'\u008a',
|
||||
'\u008b',
|
||||
'\u008c',
|
||||
'\u008d',
|
||||
'\u008e',
|
||||
'\u008f',
|
||||
'\u0090',
|
||||
'\u0091',
|
||||
'\u0092',
|
||||
'\u0093',
|
||||
'\u0094',
|
||||
'\u0095',
|
||||
'\u0096',
|
||||
'\u0097',
|
||||
'\u0098',
|
||||
'\u0099',
|
||||
'\u009a',
|
||||
'\u009b',
|
||||
'\u009c',
|
||||
'\u009d',
|
||||
'\u009e',
|
||||
'\u009f',
|
||||
'\u00a0',
|
||||
'\u0104',
|
||||
'\u02d8',
|
||||
'\u0141',
|
||||
'\u00a4',
|
||||
'\u013d',
|
||||
'\u015a',
|
||||
'\u00a7',
|
||||
'\u00a8',
|
||||
'\u0160',
|
||||
'\u015e',
|
||||
'\u0164',
|
||||
'\u0179',
|
||||
'\u00ad',
|
||||
'\u017d',
|
||||
'\u017b',
|
||||
'\u00b0',
|
||||
'\u0105',
|
||||
'\u02db',
|
||||
'\u0142',
|
||||
'\u00b4',
|
||||
'\u013e',
|
||||
'\u015b',
|
||||
'\u02c7',
|
||||
'\u00b8',
|
||||
'\u0161',
|
||||
'\u015f',
|
||||
'\u0165',
|
||||
'\u017a',
|
||||
'\u02dd',
|
||||
'\u017e',
|
||||
'\u017c',
|
||||
'\u0154',
|
||||
'\u00c1',
|
||||
'\u00c2',
|
||||
'\u0102',
|
||||
'\u00c4',
|
||||
'\u0139',
|
||||
'\u0106',
|
||||
'\u00c7',
|
||||
'\u010c',
|
||||
'\u00c9',
|
||||
'\u0118',
|
||||
'\u00cb',
|
||||
'\u011a',
|
||||
'\u00cd',
|
||||
'\u00ce',
|
||||
'\u010e',
|
||||
'\u0110',
|
||||
'\u0143',
|
||||
'\u0147',
|
||||
'\u00d3',
|
||||
'\u00d4',
|
||||
'\u0150',
|
||||
'\u00d6',
|
||||
'\u00d7',
|
||||
'\u0158',
|
||||
'\u016e',
|
||||
'\u00da',
|
||||
'\u0170',
|
||||
'\u00dc',
|
||||
'\u00dd',
|
||||
'\u0162',
|
||||
'\u00df',
|
||||
'\u0155',
|
||||
'\u00e1',
|
||||
'\u00e2',
|
||||
'\u0103',
|
||||
'\u00e4',
|
||||
'\u013a',
|
||||
'\u0107',
|
||||
'\u00e7',
|
||||
'\u010d',
|
||||
'\u00e9',
|
||||
'\u0119',
|
||||
'\u00eb',
|
||||
'\u011b',
|
||||
'\u00ed',
|
||||
'\u00ee',
|
||||
'\u010f',
|
||||
'\u0111',
|
||||
'\u0144',
|
||||
'\u0148',
|
||||
'\u00f3',
|
||||
'\u00f4',
|
||||
'\u0151',
|
||||
'\u00f6',
|
||||
'\u00f7',
|
||||
'\u0159',
|
||||
'\u016f',
|
||||
'\u00fa',
|
||||
'\u0171',
|
||||
'\u00fc',
|
||||
'\u00fd',
|
||||
'\u0163',
|
||||
'\u02d9'
|
||||
};
|
||||
|
||||
private static final String[] LABELS = {
|
||||
"csisolatin2",
|
||||
"iso-8859-2",
|
||||
"iso-ir-101",
|
||||
"iso8859-2",
|
||||
"iso88592",
|
||||
"iso_8859-2",
|
||||
"iso_8859-2:1987",
|
||||
"l2",
|
||||
"latin2"
|
||||
};
|
||||
|
||||
private static final String NAME = "iso-8859-2";
|
||||
|
||||
static final Encoding INSTANCE = new Iso2();
|
||||
|
||||
private Iso2() {
|
||||
super(NAME, LABELS);
|
||||
}
|
||||
|
||||
@Override public CharsetDecoder newDecoder() {
|
||||
return new InfallibleSingleByteDecoder(this, TABLE);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
/*
|
||||
* Copyright (c) 2013-2015 Mozilla Foundation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* THIS IS A GENERATED FILE. PLEASE DO NOT EDIT.
|
||||
* Instead, please regenerate using generate-encoding-data.py
|
||||
*/
|
||||
|
||||
package nu.validator.encoding;
|
||||
|
||||
import java.nio.charset.Charset;
|
||||
import java.nio.charset.CharsetDecoder;
|
||||
import java.nio.charset.CharsetEncoder;
|
||||
|
||||
class Iso2022Jp extends Encoding {
|
||||
|
||||
private static final String[] LABELS = {
|
||||
"csiso2022jp",
|
||||
"iso-2022-jp"
|
||||
};
|
||||
|
||||
private static final String NAME = "iso-2022-jp";
|
||||
|
||||
static final Iso2022Jp INSTANCE = new Iso2022Jp();
|
||||
|
||||
private Iso2022Jp() {
|
||||
super(NAME, LABELS);
|
||||
}
|
||||
|
||||
@Override public CharsetDecoder newDecoder() {
|
||||
return Charset.forName(NAME).newDecoder();
|
||||
}
|
||||
|
||||
@Override public CharsetEncoder newEncoder() {
|
||||
return Charset.forName(NAME).newEncoder();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,189 @@
|
||||
/*
|
||||
* Copyright (c) 2013-2015 Mozilla Foundation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* THIS IS A GENERATED FILE. PLEASE DO NOT EDIT.
|
||||
* Instead, please regenerate using generate-encoding-data.py
|
||||
*/
|
||||
|
||||
package nu.validator.encoding;
|
||||
|
||||
import java.nio.charset.CharsetDecoder;
|
||||
|
||||
class Iso3 extends Encoding {
|
||||
|
||||
private static final char[] TABLE = {
|
||||
'\u0080',
|
||||
'\u0081',
|
||||
'\u0082',
|
||||
'\u0083',
|
||||
'\u0084',
|
||||
'\u0085',
|
||||
'\u0086',
|
||||
'\u0087',
|
||||
'\u0088',
|
||||
'\u0089',
|
||||
'\u008a',
|
||||
'\u008b',
|
||||
'\u008c',
|
||||
'\u008d',
|
||||
'\u008e',
|
||||
'\u008f',
|
||||
'\u0090',
|
||||
'\u0091',
|
||||
'\u0092',
|
||||
'\u0093',
|
||||
'\u0094',
|
||||
'\u0095',
|
||||
'\u0096',
|
||||
'\u0097',
|
||||
'\u0098',
|
||||
'\u0099',
|
||||
'\u009a',
|
||||
'\u009b',
|
||||
'\u009c',
|
||||
'\u009d',
|
||||
'\u009e',
|
||||
'\u009f',
|
||||
'\u00a0',
|
||||
'\u0126',
|
||||
'\u02d8',
|
||||
'\u00a3',
|
||||
'\u00a4',
|
||||
'\ufffd',
|
||||
'\u0124',
|
||||
'\u00a7',
|
||||
'\u00a8',
|
||||
'\u0130',
|
||||
'\u015e',
|
||||
'\u011e',
|
||||
'\u0134',
|
||||
'\u00ad',
|
||||
'\ufffd',
|
||||
'\u017b',
|
||||
'\u00b0',
|
||||
'\u0127',
|
||||
'\u00b2',
|
||||
'\u00b3',
|
||||
'\u00b4',
|
||||
'\u00b5',
|
||||
'\u0125',
|
||||
'\u00b7',
|
||||
'\u00b8',
|
||||
'\u0131',
|
||||
'\u015f',
|
||||
'\u011f',
|
||||
'\u0135',
|
||||
'\u00bd',
|
||||
'\ufffd',
|
||||
'\u017c',
|
||||
'\u00c0',
|
||||
'\u00c1',
|
||||
'\u00c2',
|
||||
'\ufffd',
|
||||
'\u00c4',
|
||||
'\u010a',
|
||||
'\u0108',
|
||||
'\u00c7',
|
||||
'\u00c8',
|
||||
'\u00c9',
|
||||
'\u00ca',
|
||||
'\u00cb',
|
||||
'\u00cc',
|
||||
'\u00cd',
|
||||
'\u00ce',
|
||||
'\u00cf',
|
||||
'\ufffd',
|
||||
'\u00d1',
|
||||
'\u00d2',
|
||||
'\u00d3',
|
||||
'\u00d4',
|
||||
'\u0120',
|
||||
'\u00d6',
|
||||
'\u00d7',
|
||||
'\u011c',
|
||||
'\u00d9',
|
||||
'\u00da',
|
||||
'\u00db',
|
||||
'\u00dc',
|
||||
'\u016c',
|
||||
'\u015c',
|
||||
'\u00df',
|
||||
'\u00e0',
|
||||
'\u00e1',
|
||||
'\u00e2',
|
||||
'\ufffd',
|
||||
'\u00e4',
|
||||
'\u010b',
|
||||
'\u0109',
|
||||
'\u00e7',
|
||||
'\u00e8',
|
||||
'\u00e9',
|
||||
'\u00ea',
|
||||
'\u00eb',
|
||||
'\u00ec',
|
||||
'\u00ed',
|
||||
'\u00ee',
|
||||
'\u00ef',
|
||||
'\ufffd',
|
||||
'\u00f1',
|
||||
'\u00f2',
|
||||
'\u00f3',
|
||||
'\u00f4',
|
||||
'\u0121',
|
||||
'\u00f6',
|
||||
'\u00f7',
|
||||
'\u011d',
|
||||
'\u00f9',
|
||||
'\u00fa',
|
||||
'\u00fb',
|
||||
'\u00fc',
|
||||
'\u016d',
|
||||
'\u015d',
|
||||
'\u02d9'
|
||||
};
|
||||
|
||||
private static final String[] LABELS = {
|
||||
"csisolatin3",
|
||||
"iso-8859-3",
|
||||
"iso-ir-109",
|
||||
"iso8859-3",
|
||||
"iso88593",
|
||||
"iso_8859-3",
|
||||
"iso_8859-3:1988",
|
||||
"l3",
|
||||
"latin3"
|
||||
};
|
||||
|
||||
private static final String NAME = "iso-8859-3";
|
||||
|
||||
static final Encoding INSTANCE = new Iso3();
|
||||
|
||||
private Iso3() {
|
||||
super(NAME, LABELS);
|
||||
}
|
||||
|
||||
@Override public CharsetDecoder newDecoder() {
|
||||
return new FallibleSingleByteDecoder(this, TABLE);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,189 @@
|
||||
/*
|
||||
* Copyright (c) 2013-2015 Mozilla Foundation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* THIS IS A GENERATED FILE. PLEASE DO NOT EDIT.
|
||||
* Instead, please regenerate using generate-encoding-data.py
|
||||
*/
|
||||
|
||||
package nu.validator.encoding;
|
||||
|
||||
import java.nio.charset.CharsetDecoder;
|
||||
|
||||
class Iso4 extends Encoding {
|
||||
|
||||
private static final char[] TABLE = {
|
||||
'\u0080',
|
||||
'\u0081',
|
||||
'\u0082',
|
||||
'\u0083',
|
||||
'\u0084',
|
||||
'\u0085',
|
||||
'\u0086',
|
||||
'\u0087',
|
||||
'\u0088',
|
||||
'\u0089',
|
||||
'\u008a',
|
||||
'\u008b',
|
||||
'\u008c',
|
||||
'\u008d',
|
||||
'\u008e',
|
||||
'\u008f',
|
||||
'\u0090',
|
||||
'\u0091',
|
||||
'\u0092',
|
||||
'\u0093',
|
||||
'\u0094',
|
||||
'\u0095',
|
||||
'\u0096',
|
||||
'\u0097',
|
||||
'\u0098',
|
||||
'\u0099',
|
||||
'\u009a',
|
||||
'\u009b',
|
||||
'\u009c',
|
||||
'\u009d',
|
||||
'\u009e',
|
||||
'\u009f',
|
||||
'\u00a0',
|
||||
'\u0104',
|
||||
'\u0138',
|
||||
'\u0156',
|
||||
'\u00a4',
|
||||
'\u0128',
|
||||
'\u013b',
|
||||
'\u00a7',
|
||||
'\u00a8',
|
||||
'\u0160',
|
||||
'\u0112',
|
||||
'\u0122',
|
||||
'\u0166',
|
||||
'\u00ad',
|
||||
'\u017d',
|
||||
'\u00af',
|
||||
'\u00b0',
|
||||
'\u0105',
|
||||
'\u02db',
|
||||
'\u0157',
|
||||
'\u00b4',
|
||||
'\u0129',
|
||||
'\u013c',
|
||||
'\u02c7',
|
||||
'\u00b8',
|
||||
'\u0161',
|
||||
'\u0113',
|
||||
'\u0123',
|
||||
'\u0167',
|
||||
'\u014a',
|
||||
'\u017e',
|
||||
'\u014b',
|
||||
'\u0100',
|
||||
'\u00c1',
|
||||
'\u00c2',
|
||||
'\u00c3',
|
||||
'\u00c4',
|
||||
'\u00c5',
|
||||
'\u00c6',
|
||||
'\u012e',
|
||||
'\u010c',
|
||||
'\u00c9',
|
||||
'\u0118',
|
||||
'\u00cb',
|
||||
'\u0116',
|
||||
'\u00cd',
|
||||
'\u00ce',
|
||||
'\u012a',
|
||||
'\u0110',
|
||||
'\u0145',
|
||||
'\u014c',
|
||||
'\u0136',
|
||||
'\u00d4',
|
||||
'\u00d5',
|
||||
'\u00d6',
|
||||
'\u00d7',
|
||||
'\u00d8',
|
||||
'\u0172',
|
||||
'\u00da',
|
||||
'\u00db',
|
||||
'\u00dc',
|
||||
'\u0168',
|
||||
'\u016a',
|
||||
'\u00df',
|
||||
'\u0101',
|
||||
'\u00e1',
|
||||
'\u00e2',
|
||||
'\u00e3',
|
||||
'\u00e4',
|
||||
'\u00e5',
|
||||
'\u00e6',
|
||||
'\u012f',
|
||||
'\u010d',
|
||||
'\u00e9',
|
||||
'\u0119',
|
||||
'\u00eb',
|
||||
'\u0117',
|
||||
'\u00ed',
|
||||
'\u00ee',
|
||||
'\u012b',
|
||||
'\u0111',
|
||||
'\u0146',
|
||||
'\u014d',
|
||||
'\u0137',
|
||||
'\u00f4',
|
||||
'\u00f5',
|
||||
'\u00f6',
|
||||
'\u00f7',
|
||||
'\u00f8',
|
||||
'\u0173',
|
||||
'\u00fa',
|
||||
'\u00fb',
|
||||
'\u00fc',
|
||||
'\u0169',
|
||||
'\u016b',
|
||||
'\u02d9'
|
||||
};
|
||||
|
||||
private static final String[] LABELS = {
|
||||
"csisolatin4",
|
||||
"iso-8859-4",
|
||||
"iso-ir-110",
|
||||
"iso8859-4",
|
||||
"iso88594",
|
||||
"iso_8859-4",
|
||||
"iso_8859-4:1988",
|
||||
"l4",
|
||||
"latin4"
|
||||
};
|
||||
|
||||
private static final String NAME = "iso-8859-4";
|
||||
|
||||
static final Encoding INSTANCE = new Iso4();
|
||||
|
||||
private Iso4() {
|
||||
super(NAME, LABELS);
|
||||
}
|
||||
|
||||
@Override public CharsetDecoder newDecoder() {
|
||||
return new InfallibleSingleByteDecoder(this, TABLE);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,188 @@
|
||||
/*
|
||||
* Copyright (c) 2013-2015 Mozilla Foundation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* THIS IS A GENERATED FILE. PLEASE DO NOT EDIT.
|
||||
* Instead, please regenerate using generate-encoding-data.py
|
||||
*/
|
||||
|
||||
package nu.validator.encoding;
|
||||
|
||||
import java.nio.charset.CharsetDecoder;
|
||||
|
||||
class Iso5 extends Encoding {
|
||||
|
||||
private static final char[] TABLE = {
|
||||
'\u0080',
|
||||
'\u0081',
|
||||
'\u0082',
|
||||
'\u0083',
|
||||
'\u0084',
|
||||
'\u0085',
|
||||
'\u0086',
|
||||
'\u0087',
|
||||
'\u0088',
|
||||
'\u0089',
|
||||
'\u008a',
|
||||
'\u008b',
|
||||
'\u008c',
|
||||
'\u008d',
|
||||
'\u008e',
|
||||
'\u008f',
|
||||
'\u0090',
|
||||
'\u0091',
|
||||
'\u0092',
|
||||
'\u0093',
|
||||
'\u0094',
|
||||
'\u0095',
|
||||
'\u0096',
|
||||
'\u0097',
|
||||
'\u0098',
|
||||
'\u0099',
|
||||
'\u009a',
|
||||
'\u009b',
|
||||
'\u009c',
|
||||
'\u009d',
|
||||
'\u009e',
|
||||
'\u009f',
|
||||
'\u00a0',
|
||||
'\u0401',
|
||||
'\u0402',
|
||||
'\u0403',
|
||||
'\u0404',
|
||||
'\u0405',
|
||||
'\u0406',
|
||||
'\u0407',
|
||||
'\u0408',
|
||||
'\u0409',
|
||||
'\u040a',
|
||||
'\u040b',
|
||||
'\u040c',
|
||||
'\u00ad',
|
||||
'\u040e',
|
||||
'\u040f',
|
||||
'\u0410',
|
||||
'\u0411',
|
||||
'\u0412',
|
||||
'\u0413',
|
||||
'\u0414',
|
||||
'\u0415',
|
||||
'\u0416',
|
||||
'\u0417',
|
||||
'\u0418',
|
||||
'\u0419',
|
||||
'\u041a',
|
||||
'\u041b',
|
||||
'\u041c',
|
||||
'\u041d',
|
||||
'\u041e',
|
||||
'\u041f',
|
||||
'\u0420',
|
||||
'\u0421',
|
||||
'\u0422',
|
||||
'\u0423',
|
||||
'\u0424',
|
||||
'\u0425',
|
||||
'\u0426',
|
||||
'\u0427',
|
||||
'\u0428',
|
||||
'\u0429',
|
||||
'\u042a',
|
||||
'\u042b',
|
||||
'\u042c',
|
||||
'\u042d',
|
||||
'\u042e',
|
||||
'\u042f',
|
||||
'\u0430',
|
||||
'\u0431',
|
||||
'\u0432',
|
||||
'\u0433',
|
||||
'\u0434',
|
||||
'\u0435',
|
||||
'\u0436',
|
||||
'\u0437',
|
||||
'\u0438',
|
||||
'\u0439',
|
||||
'\u043a',
|
||||
'\u043b',
|
||||
'\u043c',
|
||||
'\u043d',
|
||||
'\u043e',
|
||||
'\u043f',
|
||||
'\u0440',
|
||||
'\u0441',
|
||||
'\u0442',
|
||||
'\u0443',
|
||||
'\u0444',
|
||||
'\u0445',
|
||||
'\u0446',
|
||||
'\u0447',
|
||||
'\u0448',
|
||||
'\u0449',
|
||||
'\u044a',
|
||||
'\u044b',
|
||||
'\u044c',
|
||||
'\u044d',
|
||||
'\u044e',
|
||||
'\u044f',
|
||||
'\u2116',
|
||||
'\u0451',
|
||||
'\u0452',
|
||||
'\u0453',
|
||||
'\u0454',
|
||||
'\u0455',
|
||||
'\u0456',
|
||||
'\u0457',
|
||||
'\u0458',
|
||||
'\u0459',
|
||||
'\u045a',
|
||||
'\u045b',
|
||||
'\u045c',
|
||||
'\u00a7',
|
||||
'\u045e',
|
||||
'\u045f'
|
||||
};
|
||||
|
||||
private static final String[] LABELS = {
|
||||
"csisolatincyrillic",
|
||||
"cyrillic",
|
||||
"iso-8859-5",
|
||||
"iso-ir-144",
|
||||
"iso8859-5",
|
||||
"iso88595",
|
||||
"iso_8859-5",
|
||||
"iso_8859-5:1988"
|
||||
};
|
||||
|
||||
private static final String NAME = "iso-8859-5";
|
||||
|
||||
static final Encoding INSTANCE = new Iso5();
|
||||
|
||||
private Iso5() {
|
||||
super(NAME, LABELS);
|
||||
}
|
||||
|
||||
@Override public CharsetDecoder newDecoder() {
|
||||
return new InfallibleSingleByteDecoder(this, TABLE);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,194 @@
|
||||
/*
|
||||
* Copyright (c) 2013-2015 Mozilla Foundation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* THIS IS A GENERATED FILE. PLEASE DO NOT EDIT.
|
||||
* Instead, please regenerate using generate-encoding-data.py
|
||||
*/
|
||||
|
||||
package nu.validator.encoding;
|
||||
|
||||
import java.nio.charset.CharsetDecoder;
|
||||
|
||||
class Iso6 extends Encoding {
|
||||
|
||||
private static final char[] TABLE = {
|
||||
'\u0080',
|
||||
'\u0081',
|
||||
'\u0082',
|
||||
'\u0083',
|
||||
'\u0084',
|
||||
'\u0085',
|
||||
'\u0086',
|
||||
'\u0087',
|
||||
'\u0088',
|
||||
'\u0089',
|
||||
'\u008a',
|
||||
'\u008b',
|
||||
'\u008c',
|
||||
'\u008d',
|
||||
'\u008e',
|
||||
'\u008f',
|
||||
'\u0090',
|
||||
'\u0091',
|
||||
'\u0092',
|
||||
'\u0093',
|
||||
'\u0094',
|
||||
'\u0095',
|
||||
'\u0096',
|
||||
'\u0097',
|
||||
'\u0098',
|
||||
'\u0099',
|
||||
'\u009a',
|
||||
'\u009b',
|
||||
'\u009c',
|
||||
'\u009d',
|
||||
'\u009e',
|
||||
'\u009f',
|
||||
'\u00a0',
|
||||
'\ufffd',
|
||||
'\ufffd',
|
||||
'\ufffd',
|
||||
'\u00a4',
|
||||
'\ufffd',
|
||||
'\ufffd',
|
||||
'\ufffd',
|
||||
'\ufffd',
|
||||
'\ufffd',
|
||||
'\ufffd',
|
||||
'\ufffd',
|
||||
'\u060c',
|
||||
'\u00ad',
|
||||
'\ufffd',
|
||||
'\ufffd',
|
||||
'\ufffd',
|
||||
'\ufffd',
|
||||
'\ufffd',
|
||||
'\ufffd',
|
||||
'\ufffd',
|
||||
'\ufffd',
|
||||
'\ufffd',
|
||||
'\ufffd',
|
||||
'\ufffd',
|
||||
'\ufffd',
|
||||
'\ufffd',
|
||||
'\u061b',
|
||||
'\ufffd',
|
||||
'\ufffd',
|
||||
'\ufffd',
|
||||
'\u061f',
|
||||
'\ufffd',
|
||||
'\u0621',
|
||||
'\u0622',
|
||||
'\u0623',
|
||||
'\u0624',
|
||||
'\u0625',
|
||||
'\u0626',
|
||||
'\u0627',
|
||||
'\u0628',
|
||||
'\u0629',
|
||||
'\u062a',
|
||||
'\u062b',
|
||||
'\u062c',
|
||||
'\u062d',
|
||||
'\u062e',
|
||||
'\u062f',
|
||||
'\u0630',
|
||||
'\u0631',
|
||||
'\u0632',
|
||||
'\u0633',
|
||||
'\u0634',
|
||||
'\u0635',
|
||||
'\u0636',
|
||||
'\u0637',
|
||||
'\u0638',
|
||||
'\u0639',
|
||||
'\u063a',
|
||||
'\ufffd',
|
||||
'\ufffd',
|
||||
'\ufffd',
|
||||
'\ufffd',
|
||||
'\ufffd',
|
||||
'\u0640',
|
||||
'\u0641',
|
||||
'\u0642',
|
||||
'\u0643',
|
||||
'\u0644',
|
||||
'\u0645',
|
||||
'\u0646',
|
||||
'\u0647',
|
||||
'\u0648',
|
||||
'\u0649',
|
||||
'\u064a',
|
||||
'\u064b',
|
||||
'\u064c',
|
||||
'\u064d',
|
||||
'\u064e',
|
||||
'\u064f',
|
||||
'\u0650',
|
||||
'\u0651',
|
||||
'\u0652',
|
||||
'\ufffd',
|
||||
'\ufffd',
|
||||
'\ufffd',
|
||||
'\ufffd',
|
||||
'\ufffd',
|
||||
'\ufffd',
|
||||
'\ufffd',
|
||||
'\ufffd',
|
||||
'\ufffd',
|
||||
'\ufffd',
|
||||
'\ufffd',
|
||||
'\ufffd',
|
||||
'\ufffd'
|
||||
};
|
||||
|
||||
private static final String[] LABELS = {
|
||||
"arabic",
|
||||
"asmo-708",
|
||||
"csiso88596e",
|
||||
"csiso88596i",
|
||||
"csisolatinarabic",
|
||||
"ecma-114",
|
||||
"iso-8859-6",
|
||||
"iso-8859-6-e",
|
||||
"iso-8859-6-i",
|
||||
"iso-ir-127",
|
||||
"iso8859-6",
|
||||
"iso88596",
|
||||
"iso_8859-6",
|
||||
"iso_8859-6:1987"
|
||||
};
|
||||
|
||||
private static final String NAME = "iso-8859-6";
|
||||
|
||||
static final Encoding INSTANCE = new Iso6();
|
||||
|
||||
private Iso6() {
|
||||
super(NAME, LABELS);
|
||||
}
|
||||
|
||||
@Override public CharsetDecoder newDecoder() {
|
||||
return new FallibleSingleByteDecoder(this, TABLE);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,192 @@
|
||||
/*
|
||||
* Copyright (c) 2013-2015 Mozilla Foundation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* THIS IS A GENERATED FILE. PLEASE DO NOT EDIT.
|
||||
* Instead, please regenerate using generate-encoding-data.py
|
||||
*/
|
||||
|
||||
package nu.validator.encoding;
|
||||
|
||||
import java.nio.charset.CharsetDecoder;
|
||||
|
||||
class Iso7 extends Encoding {
|
||||
|
||||
private static final char[] TABLE = {
|
||||
'\u0080',
|
||||
'\u0081',
|
||||
'\u0082',
|
||||
'\u0083',
|
||||
'\u0084',
|
||||
'\u0085',
|
||||
'\u0086',
|
||||
'\u0087',
|
||||
'\u0088',
|
||||
'\u0089',
|
||||
'\u008a',
|
||||
'\u008b',
|
||||
'\u008c',
|
||||
'\u008d',
|
||||
'\u008e',
|
||||
'\u008f',
|
||||
'\u0090',
|
||||
'\u0091',
|
||||
'\u0092',
|
||||
'\u0093',
|
||||
'\u0094',
|
||||
'\u0095',
|
||||
'\u0096',
|
||||
'\u0097',
|
||||
'\u0098',
|
||||
'\u0099',
|
||||
'\u009a',
|
||||
'\u009b',
|
||||
'\u009c',
|
||||
'\u009d',
|
||||
'\u009e',
|
||||
'\u009f',
|
||||
'\u00a0',
|
||||
'\u2018',
|
||||
'\u2019',
|
||||
'\u00a3',
|
||||
'\u20ac',
|
||||
'\u20af',
|
||||
'\u00a6',
|
||||
'\u00a7',
|
||||
'\u00a8',
|
||||
'\u00a9',
|
||||
'\u037a',
|
||||
'\u00ab',
|
||||
'\u00ac',
|
||||
'\u00ad',
|
||||
'\ufffd',
|
||||
'\u2015',
|
||||
'\u00b0',
|
||||
'\u00b1',
|
||||
'\u00b2',
|
||||
'\u00b3',
|
||||
'\u0384',
|
||||
'\u0385',
|
||||
'\u0386',
|
||||
'\u00b7',
|
||||
'\u0388',
|
||||
'\u0389',
|
||||
'\u038a',
|
||||
'\u00bb',
|
||||
'\u038c',
|
||||
'\u00bd',
|
||||
'\u038e',
|
||||
'\u038f',
|
||||
'\u0390',
|
||||
'\u0391',
|
||||
'\u0392',
|
||||
'\u0393',
|
||||
'\u0394',
|
||||
'\u0395',
|
||||
'\u0396',
|
||||
'\u0397',
|
||||
'\u0398',
|
||||
'\u0399',
|
||||
'\u039a',
|
||||
'\u039b',
|
||||
'\u039c',
|
||||
'\u039d',
|
||||
'\u039e',
|
||||
'\u039f',
|
||||
'\u03a0',
|
||||
'\u03a1',
|
||||
'\ufffd',
|
||||
'\u03a3',
|
||||
'\u03a4',
|
||||
'\u03a5',
|
||||
'\u03a6',
|
||||
'\u03a7',
|
||||
'\u03a8',
|
||||
'\u03a9',
|
||||
'\u03aa',
|
||||
'\u03ab',
|
||||
'\u03ac',
|
||||
'\u03ad',
|
||||
'\u03ae',
|
||||
'\u03af',
|
||||
'\u03b0',
|
||||
'\u03b1',
|
||||
'\u03b2',
|
||||
'\u03b3',
|
||||
'\u03b4',
|
||||
'\u03b5',
|
||||
'\u03b6',
|
||||
'\u03b7',
|
||||
'\u03b8',
|
||||
'\u03b9',
|
||||
'\u03ba',
|
||||
'\u03bb',
|
||||
'\u03bc',
|
||||
'\u03bd',
|
||||
'\u03be',
|
||||
'\u03bf',
|
||||
'\u03c0',
|
||||
'\u03c1',
|
||||
'\u03c2',
|
||||
'\u03c3',
|
||||
'\u03c4',
|
||||
'\u03c5',
|
||||
'\u03c6',
|
||||
'\u03c7',
|
||||
'\u03c8',
|
||||
'\u03c9',
|
||||
'\u03ca',
|
||||
'\u03cb',
|
||||
'\u03cc',
|
||||
'\u03cd',
|
||||
'\u03ce',
|
||||
'\ufffd'
|
||||
};
|
||||
|
||||
private static final String[] LABELS = {
|
||||
"csisolatingreek",
|
||||
"ecma-118",
|
||||
"elot_928",
|
||||
"greek",
|
||||
"greek8",
|
||||
"iso-8859-7",
|
||||
"iso-ir-126",
|
||||
"iso8859-7",
|
||||
"iso88597",
|
||||
"iso_8859-7",
|
||||
"iso_8859-7:1987",
|
||||
"sun_eu_greek"
|
||||
};
|
||||
|
||||
private static final String NAME = "iso-8859-7";
|
||||
|
||||
static final Encoding INSTANCE = new Iso7();
|
||||
|
||||
private Iso7() {
|
||||
super(NAME, LABELS);
|
||||
}
|
||||
|
||||
@Override public CharsetDecoder newDecoder() {
|
||||
return new FallibleSingleByteDecoder(this, TABLE);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,191 @@
|
||||
/*
|
||||
* Copyright (c) 2013-2015 Mozilla Foundation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* THIS IS A GENERATED FILE. PLEASE DO NOT EDIT.
|
||||
* Instead, please regenerate using generate-encoding-data.py
|
||||
*/
|
||||
|
||||
package nu.validator.encoding;
|
||||
|
||||
import java.nio.charset.CharsetDecoder;
|
||||
|
||||
class Iso8 extends Encoding {
|
||||
|
||||
private static final char[] TABLE = {
|
||||
'\u0080',
|
||||
'\u0081',
|
||||
'\u0082',
|
||||
'\u0083',
|
||||
'\u0084',
|
||||
'\u0085',
|
||||
'\u0086',
|
||||
'\u0087',
|
||||
'\u0088',
|
||||
'\u0089',
|
||||
'\u008a',
|
||||
'\u008b',
|
||||
'\u008c',
|
||||
'\u008d',
|
||||
'\u008e',
|
||||
'\u008f',
|
||||
'\u0090',
|
||||
'\u0091',
|
||||
'\u0092',
|
||||
'\u0093',
|
||||
'\u0094',
|
||||
'\u0095',
|
||||
'\u0096',
|
||||
'\u0097',
|
||||
'\u0098',
|
||||
'\u0099',
|
||||
'\u009a',
|
||||
'\u009b',
|
||||
'\u009c',
|
||||
'\u009d',
|
||||
'\u009e',
|
||||
'\u009f',
|
||||
'\u00a0',
|
||||
'\ufffd',
|
||||
'\u00a2',
|
||||
'\u00a3',
|
||||
'\u00a4',
|
||||
'\u00a5',
|
||||
'\u00a6',
|
||||
'\u00a7',
|
||||
'\u00a8',
|
||||
'\u00a9',
|
||||
'\u00d7',
|
||||
'\u00ab',
|
||||
'\u00ac',
|
||||
'\u00ad',
|
||||
'\u00ae',
|
||||
'\u00af',
|
||||
'\u00b0',
|
||||
'\u00b1',
|
||||
'\u00b2',
|
||||
'\u00b3',
|
||||
'\u00b4',
|
||||
'\u00b5',
|
||||
'\u00b6',
|
||||
'\u00b7',
|
||||
'\u00b8',
|
||||
'\u00b9',
|
||||
'\u00f7',
|
||||
'\u00bb',
|
||||
'\u00bc',
|
||||
'\u00bd',
|
||||
'\u00be',
|
||||
'\ufffd',
|
||||
'\ufffd',
|
||||
'\ufffd',
|
||||
'\ufffd',
|
||||
'\ufffd',
|
||||
'\ufffd',
|
||||
'\ufffd',
|
||||
'\ufffd',
|
||||
'\ufffd',
|
||||
'\ufffd',
|
||||
'\ufffd',
|
||||
'\ufffd',
|
||||
'\ufffd',
|
||||
'\ufffd',
|
||||
'\ufffd',
|
||||
'\ufffd',
|
||||
'\ufffd',
|
||||
'\ufffd',
|
||||
'\ufffd',
|
||||
'\ufffd',
|
||||
'\ufffd',
|
||||
'\ufffd',
|
||||
'\ufffd',
|
||||
'\ufffd',
|
||||
'\ufffd',
|
||||
'\ufffd',
|
||||
'\ufffd',
|
||||
'\ufffd',
|
||||
'\ufffd',
|
||||
'\ufffd',
|
||||
'\ufffd',
|
||||
'\ufffd',
|
||||
'\u2017',
|
||||
'\u05d0',
|
||||
'\u05d1',
|
||||
'\u05d2',
|
||||
'\u05d3',
|
||||
'\u05d4',
|
||||
'\u05d5',
|
||||
'\u05d6',
|
||||
'\u05d7',
|
||||
'\u05d8',
|
||||
'\u05d9',
|
||||
'\u05da',
|
||||
'\u05db',
|
||||
'\u05dc',
|
||||
'\u05dd',
|
||||
'\u05de',
|
||||
'\u05df',
|
||||
'\u05e0',
|
||||
'\u05e1',
|
||||
'\u05e2',
|
||||
'\u05e3',
|
||||
'\u05e4',
|
||||
'\u05e5',
|
||||
'\u05e6',
|
||||
'\u05e7',
|
||||
'\u05e8',
|
||||
'\u05e9',
|
||||
'\u05ea',
|
||||
'\ufffd',
|
||||
'\ufffd',
|
||||
'\u200e',
|
||||
'\u200f',
|
||||
'\ufffd'
|
||||
};
|
||||
|
||||
private static final String[] LABELS = {
|
||||
"csiso88598e",
|
||||
"csisolatinhebrew",
|
||||
"hebrew",
|
||||
"iso-8859-8",
|
||||
"iso-8859-8-e",
|
||||
"iso-ir-138",
|
||||
"iso8859-8",
|
||||
"iso88598",
|
||||
"iso_8859-8",
|
||||
"iso_8859-8:1988",
|
||||
"visual"
|
||||
};
|
||||
|
||||
private static final String NAME = "iso-8859-8";
|
||||
|
||||
static final Encoding INSTANCE = new Iso8();
|
||||
|
||||
private Iso8() {
|
||||
super(NAME, LABELS);
|
||||
}
|
||||
|
||||
@Override public CharsetDecoder newDecoder() {
|
||||
return new FallibleSingleByteDecoder(this, TABLE);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,183 @@
|
||||
/*
|
||||
* Copyright (c) 2013-2015 Mozilla Foundation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* THIS IS A GENERATED FILE. PLEASE DO NOT EDIT.
|
||||
* Instead, please regenerate using generate-encoding-data.py
|
||||
*/
|
||||
|
||||
package nu.validator.encoding;
|
||||
|
||||
import java.nio.charset.CharsetDecoder;
|
||||
|
||||
class Iso8I extends Encoding {
|
||||
|
||||
private static final char[] TABLE = {
|
||||
'\u0080',
|
||||
'\u0081',
|
||||
'\u0082',
|
||||
'\u0083',
|
||||
'\u0084',
|
||||
'\u0085',
|
||||
'\u0086',
|
||||
'\u0087',
|
||||
'\u0088',
|
||||
'\u0089',
|
||||
'\u008a',
|
||||
'\u008b',
|
||||
'\u008c',
|
||||
'\u008d',
|
||||
'\u008e',
|
||||
'\u008f',
|
||||
'\u0090',
|
||||
'\u0091',
|
||||
'\u0092',
|
||||
'\u0093',
|
||||
'\u0094',
|
||||
'\u0095',
|
||||
'\u0096',
|
||||
'\u0097',
|
||||
'\u0098',
|
||||
'\u0099',
|
||||
'\u009a',
|
||||
'\u009b',
|
||||
'\u009c',
|
||||
'\u009d',
|
||||
'\u009e',
|
||||
'\u009f',
|
||||
'\u00a0',
|
||||
'\ufffd',
|
||||
'\u00a2',
|
||||
'\u00a3',
|
||||
'\u00a4',
|
||||
'\u00a5',
|
||||
'\u00a6',
|
||||
'\u00a7',
|
||||
'\u00a8',
|
||||
'\u00a9',
|
||||
'\u00d7',
|
||||
'\u00ab',
|
||||
'\u00ac',
|
||||
'\u00ad',
|
||||
'\u00ae',
|
||||
'\u00af',
|
||||
'\u00b0',
|
||||
'\u00b1',
|
||||
'\u00b2',
|
||||
'\u00b3',
|
||||
'\u00b4',
|
||||
'\u00b5',
|
||||
'\u00b6',
|
||||
'\u00b7',
|
||||
'\u00b8',
|
||||
'\u00b9',
|
||||
'\u00f7',
|
||||
'\u00bb',
|
||||
'\u00bc',
|
||||
'\u00bd',
|
||||
'\u00be',
|
||||
'\ufffd',
|
||||
'\ufffd',
|
||||
'\ufffd',
|
||||
'\ufffd',
|
||||
'\ufffd',
|
||||
'\ufffd',
|
||||
'\ufffd',
|
||||
'\ufffd',
|
||||
'\ufffd',
|
||||
'\ufffd',
|
||||
'\ufffd',
|
||||
'\ufffd',
|
||||
'\ufffd',
|
||||
'\ufffd',
|
||||
'\ufffd',
|
||||
'\ufffd',
|
||||
'\ufffd',
|
||||
'\ufffd',
|
||||
'\ufffd',
|
||||
'\ufffd',
|
||||
'\ufffd',
|
||||
'\ufffd',
|
||||
'\ufffd',
|
||||
'\ufffd',
|
||||
'\ufffd',
|
||||
'\ufffd',
|
||||
'\ufffd',
|
||||
'\ufffd',
|
||||
'\ufffd',
|
||||
'\ufffd',
|
||||
'\ufffd',
|
||||
'\ufffd',
|
||||
'\u2017',
|
||||
'\u05d0',
|
||||
'\u05d1',
|
||||
'\u05d2',
|
||||
'\u05d3',
|
||||
'\u05d4',
|
||||
'\u05d5',
|
||||
'\u05d6',
|
||||
'\u05d7',
|
||||
'\u05d8',
|
||||
'\u05d9',
|
||||
'\u05da',
|
||||
'\u05db',
|
||||
'\u05dc',
|
||||
'\u05dd',
|
||||
'\u05de',
|
||||
'\u05df',
|
||||
'\u05e0',
|
||||
'\u05e1',
|
||||
'\u05e2',
|
||||
'\u05e3',
|
||||
'\u05e4',
|
||||
'\u05e5',
|
||||
'\u05e6',
|
||||
'\u05e7',
|
||||
'\u05e8',
|
||||
'\u05e9',
|
||||
'\u05ea',
|
||||
'\ufffd',
|
||||
'\ufffd',
|
||||
'\u200e',
|
||||
'\u200f',
|
||||
'\ufffd'
|
||||
};
|
||||
|
||||
private static final String[] LABELS = {
|
||||
"csiso88598i",
|
||||
"iso-8859-8-i",
|
||||
"logical"
|
||||
};
|
||||
|
||||
private static final String NAME = "iso-8859-8-i";
|
||||
|
||||
static final Encoding INSTANCE = new Iso8I();
|
||||
|
||||
private Iso8I() {
|
||||
super(NAME, LABELS);
|
||||
}
|
||||
|
||||
@Override public CharsetDecoder newDecoder() {
|
||||
return new FallibleSingleByteDecoder(this, TABLE);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,185 @@
|
||||
/*
|
||||
* Copyright (c) 2013-2015 Mozilla Foundation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* THIS IS A GENERATED FILE. PLEASE DO NOT EDIT.
|
||||
* Instead, please regenerate using generate-encoding-data.py
|
||||
*/
|
||||
|
||||
package nu.validator.encoding;
|
||||
|
||||
import java.nio.charset.CharsetDecoder;
|
||||
|
||||
class Koi8R extends Encoding {
|
||||
|
||||
private static final char[] TABLE = {
|
||||
'\u2500',
|
||||
'\u2502',
|
||||
'\u250c',
|
||||
'\u2510',
|
||||
'\u2514',
|
||||
'\u2518',
|
||||
'\u251c',
|
||||
'\u2524',
|
||||
'\u252c',
|
||||
'\u2534',
|
||||
'\u253c',
|
||||
'\u2580',
|
||||
'\u2584',
|
||||
'\u2588',
|
||||
'\u258c',
|
||||
'\u2590',
|
||||
'\u2591',
|
||||
'\u2592',
|
||||
'\u2593',
|
||||
'\u2320',
|
||||
'\u25a0',
|
||||
'\u2219',
|
||||
'\u221a',
|
||||
'\u2248',
|
||||
'\u2264',
|
||||
'\u2265',
|
||||
'\u00a0',
|
||||
'\u2321',
|
||||
'\u00b0',
|
||||
'\u00b2',
|
||||
'\u00b7',
|
||||
'\u00f7',
|
||||
'\u2550',
|
||||
'\u2551',
|
||||
'\u2552',
|
||||
'\u0451',
|
||||
'\u2553',
|
||||
'\u2554',
|
||||
'\u2555',
|
||||
'\u2556',
|
||||
'\u2557',
|
||||
'\u2558',
|
||||
'\u2559',
|
||||
'\u255a',
|
||||
'\u255b',
|
||||
'\u255c',
|
||||
'\u255d',
|
||||
'\u255e',
|
||||
'\u255f',
|
||||
'\u2560',
|
||||
'\u2561',
|
||||
'\u0401',
|
||||
'\u2562',
|
||||
'\u2563',
|
||||
'\u2564',
|
||||
'\u2565',
|
||||
'\u2566',
|
||||
'\u2567',
|
||||
'\u2568',
|
||||
'\u2569',
|
||||
'\u256a',
|
||||
'\u256b',
|
||||
'\u256c',
|
||||
'\u00a9',
|
||||
'\u044e',
|
||||
'\u0430',
|
||||
'\u0431',
|
||||
'\u0446',
|
||||
'\u0434',
|
||||
'\u0435',
|
||||
'\u0444',
|
||||
'\u0433',
|
||||
'\u0445',
|
||||
'\u0438',
|
||||
'\u0439',
|
||||
'\u043a',
|
||||
'\u043b',
|
||||
'\u043c',
|
||||
'\u043d',
|
||||
'\u043e',
|
||||
'\u043f',
|
||||
'\u044f',
|
||||
'\u0440',
|
||||
'\u0441',
|
||||
'\u0442',
|
||||
'\u0443',
|
||||
'\u0436',
|
||||
'\u0432',
|
||||
'\u044c',
|
||||
'\u044b',
|
||||
'\u0437',
|
||||
'\u0448',
|
||||
'\u044d',
|
||||
'\u0449',
|
||||
'\u0447',
|
||||
'\u044a',
|
||||
'\u042e',
|
||||
'\u0410',
|
||||
'\u0411',
|
||||
'\u0426',
|
||||
'\u0414',
|
||||
'\u0415',
|
||||
'\u0424',
|
||||
'\u0413',
|
||||
'\u0425',
|
||||
'\u0418',
|
||||
'\u0419',
|
||||
'\u041a',
|
||||
'\u041b',
|
||||
'\u041c',
|
||||
'\u041d',
|
||||
'\u041e',
|
||||
'\u041f',
|
||||
'\u042f',
|
||||
'\u0420',
|
||||
'\u0421',
|
||||
'\u0422',
|
||||
'\u0423',
|
||||
'\u0416',
|
||||
'\u0412',
|
||||
'\u042c',
|
||||
'\u042b',
|
||||
'\u0417',
|
||||
'\u0428',
|
||||
'\u042d',
|
||||
'\u0429',
|
||||
'\u0427',
|
||||
'\u042a'
|
||||
};
|
||||
|
||||
private static final String[] LABELS = {
|
||||
"cskoi8r",
|
||||
"koi",
|
||||
"koi8",
|
||||
"koi8-r",
|
||||
"koi8_r"
|
||||
};
|
||||
|
||||
private static final String NAME = "koi8-r";
|
||||
|
||||
static final Encoding INSTANCE = new Koi8R();
|
||||
|
||||
private Koi8R() {
|
||||
super(NAME, LABELS);
|
||||
}
|
||||
|
||||
@Override public CharsetDecoder newDecoder() {
|
||||
return new InfallibleSingleByteDecoder(this, TABLE);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,182 @@
|
||||
/*
|
||||
* Copyright (c) 2013-2015 Mozilla Foundation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* THIS IS A GENERATED FILE. PLEASE DO NOT EDIT.
|
||||
* Instead, please regenerate using generate-encoding-data.py
|
||||
*/
|
||||
|
||||
package nu.validator.encoding;
|
||||
|
||||
import java.nio.charset.CharsetDecoder;
|
||||
|
||||
class Koi8U extends Encoding {
|
||||
|
||||
private static final char[] TABLE = {
|
||||
'\u2500',
|
||||
'\u2502',
|
||||
'\u250c',
|
||||
'\u2510',
|
||||
'\u2514',
|
||||
'\u2518',
|
||||
'\u251c',
|
||||
'\u2524',
|
||||
'\u252c',
|
||||
'\u2534',
|
||||
'\u253c',
|
||||
'\u2580',
|
||||
'\u2584',
|
||||
'\u2588',
|
||||
'\u258c',
|
||||
'\u2590',
|
||||
'\u2591',
|
||||
'\u2592',
|
||||
'\u2593',
|
||||
'\u2320',
|
||||
'\u25a0',
|
||||
'\u2219',
|
||||
'\u221a',
|
||||
'\u2248',
|
||||
'\u2264',
|
||||
'\u2265',
|
||||
'\u00a0',
|
||||
'\u2321',
|
||||
'\u00b0',
|
||||
'\u00b2',
|
||||
'\u00b7',
|
||||
'\u00f7',
|
||||
'\u2550',
|
||||
'\u2551',
|
||||
'\u2552',
|
||||
'\u0451',
|
||||
'\u0454',
|
||||
'\u2554',
|
||||
'\u0456',
|
||||
'\u0457',
|
||||
'\u2557',
|
||||
'\u2558',
|
||||
'\u2559',
|
||||
'\u255a',
|
||||
'\u255b',
|
||||
'\u0491',
|
||||
'\u045e',
|
||||
'\u255e',
|
||||
'\u255f',
|
||||
'\u2560',
|
||||
'\u2561',
|
||||
'\u0401',
|
||||
'\u0404',
|
||||
'\u2563',
|
||||
'\u0406',
|
||||
'\u0407',
|
||||
'\u2566',
|
||||
'\u2567',
|
||||
'\u2568',
|
||||
'\u2569',
|
||||
'\u256a',
|
||||
'\u0490',
|
||||
'\u040e',
|
||||
'\u00a9',
|
||||
'\u044e',
|
||||
'\u0430',
|
||||
'\u0431',
|
||||
'\u0446',
|
||||
'\u0434',
|
||||
'\u0435',
|
||||
'\u0444',
|
||||
'\u0433',
|
||||
'\u0445',
|
||||
'\u0438',
|
||||
'\u0439',
|
||||
'\u043a',
|
||||
'\u043b',
|
||||
'\u043c',
|
||||
'\u043d',
|
||||
'\u043e',
|
||||
'\u043f',
|
||||
'\u044f',
|
||||
'\u0440',
|
||||
'\u0441',
|
||||
'\u0442',
|
||||
'\u0443',
|
||||
'\u0436',
|
||||
'\u0432',
|
||||
'\u044c',
|
||||
'\u044b',
|
||||
'\u0437',
|
||||
'\u0448',
|
||||
'\u044d',
|
||||
'\u0449',
|
||||
'\u0447',
|
||||
'\u044a',
|
||||
'\u042e',
|
||||
'\u0410',
|
||||
'\u0411',
|
||||
'\u0426',
|
||||
'\u0414',
|
||||
'\u0415',
|
||||
'\u0424',
|
||||
'\u0413',
|
||||
'\u0425',
|
||||
'\u0418',
|
||||
'\u0419',
|
||||
'\u041a',
|
||||
'\u041b',
|
||||
'\u041c',
|
||||
'\u041d',
|
||||
'\u041e',
|
||||
'\u041f',
|
||||
'\u042f',
|
||||
'\u0420',
|
||||
'\u0421',
|
||||
'\u0422',
|
||||
'\u0423',
|
||||
'\u0416',
|
||||
'\u0412',
|
||||
'\u042c',
|
||||
'\u042b',
|
||||
'\u0417',
|
||||
'\u0428',
|
||||
'\u042d',
|
||||
'\u0429',
|
||||
'\u0427',
|
||||
'\u042a'
|
||||
};
|
||||
|
||||
private static final String[] LABELS = {
|
||||
"koi8-ru",
|
||||
"koi8-u"
|
||||
};
|
||||
|
||||
private static final String NAME = "koi8-u";
|
||||
|
||||
static final Encoding INSTANCE = new Koi8U();
|
||||
|
||||
private Koi8U() {
|
||||
super(NAME, LABELS);
|
||||
}
|
||||
|
||||
@Override public CharsetDecoder newDecoder() {
|
||||
return new InfallibleSingleByteDecoder(this, TABLE);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,182 @@
|
||||
/*
|
||||
* Copyright (c) 2013-2015 Mozilla Foundation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* THIS IS A GENERATED FILE. PLEASE DO NOT EDIT.
|
||||
* Instead, please regenerate using generate-encoding-data.py
|
||||
*/
|
||||
|
||||
package nu.validator.encoding;
|
||||
|
||||
import java.nio.charset.CharsetDecoder;
|
||||
|
||||
class MacCyrillic extends Encoding {
|
||||
|
||||
private static final char[] TABLE = {
|
||||
'\u0410',
|
||||
'\u0411',
|
||||
'\u0412',
|
||||
'\u0413',
|
||||
'\u0414',
|
||||
'\u0415',
|
||||
'\u0416',
|
||||
'\u0417',
|
||||
'\u0418',
|
||||
'\u0419',
|
||||
'\u041a',
|
||||
'\u041b',
|
||||
'\u041c',
|
||||
'\u041d',
|
||||
'\u041e',
|
||||
'\u041f',
|
||||
'\u0420',
|
||||
'\u0421',
|
||||
'\u0422',
|
||||
'\u0423',
|
||||
'\u0424',
|
||||
'\u0425',
|
||||
'\u0426',
|
||||
'\u0427',
|
||||
'\u0428',
|
||||
'\u0429',
|
||||
'\u042a',
|
||||
'\u042b',
|
||||
'\u042c',
|
||||
'\u042d',
|
||||
'\u042e',
|
||||
'\u042f',
|
||||
'\u2020',
|
||||
'\u00b0',
|
||||
'\u0490',
|
||||
'\u00a3',
|
||||
'\u00a7',
|
||||
'\u2022',
|
||||
'\u00b6',
|
||||
'\u0406',
|
||||
'\u00ae',
|
||||
'\u00a9',
|
||||
'\u2122',
|
||||
'\u0402',
|
||||
'\u0452',
|
||||
'\u2260',
|
||||
'\u0403',
|
||||
'\u0453',
|
||||
'\u221e',
|
||||
'\u00b1',
|
||||
'\u2264',
|
||||
'\u2265',
|
||||
'\u0456',
|
||||
'\u00b5',
|
||||
'\u0491',
|
||||
'\u0408',
|
||||
'\u0404',
|
||||
'\u0454',
|
||||
'\u0407',
|
||||
'\u0457',
|
||||
'\u0409',
|
||||
'\u0459',
|
||||
'\u040a',
|
||||
'\u045a',
|
||||
'\u0458',
|
||||
'\u0405',
|
||||
'\u00ac',
|
||||
'\u221a',
|
||||
'\u0192',
|
||||
'\u2248',
|
||||
'\u2206',
|
||||
'\u00ab',
|
||||
'\u00bb',
|
||||
'\u2026',
|
||||
'\u00a0',
|
||||
'\u040b',
|
||||
'\u045b',
|
||||
'\u040c',
|
||||
'\u045c',
|
||||
'\u0455',
|
||||
'\u2013',
|
||||
'\u2014',
|
||||
'\u201c',
|
||||
'\u201d',
|
||||
'\u2018',
|
||||
'\u2019',
|
||||
'\u00f7',
|
||||
'\u201e',
|
||||
'\u040e',
|
||||
'\u045e',
|
||||
'\u040f',
|
||||
'\u045f',
|
||||
'\u2116',
|
||||
'\u0401',
|
||||
'\u0451',
|
||||
'\u044f',
|
||||
'\u0430',
|
||||
'\u0431',
|
||||
'\u0432',
|
||||
'\u0433',
|
||||
'\u0434',
|
||||
'\u0435',
|
||||
'\u0436',
|
||||
'\u0437',
|
||||
'\u0438',
|
||||
'\u0439',
|
||||
'\u043a',
|
||||
'\u043b',
|
||||
'\u043c',
|
||||
'\u043d',
|
||||
'\u043e',
|
||||
'\u043f',
|
||||
'\u0440',
|
||||
'\u0441',
|
||||
'\u0442',
|
||||
'\u0443',
|
||||
'\u0444',
|
||||
'\u0445',
|
||||
'\u0446',
|
||||
'\u0447',
|
||||
'\u0448',
|
||||
'\u0449',
|
||||
'\u044a',
|
||||
'\u044b',
|
||||
'\u044c',
|
||||
'\u044d',
|
||||
'\u044e',
|
||||
'\u20ac'
|
||||
};
|
||||
|
||||
private static final String[] LABELS = {
|
||||
"x-mac-cyrillic",
|
||||
"x-mac-ukrainian"
|
||||
};
|
||||
|
||||
private static final String NAME = "x-mac-cyrillic";
|
||||
|
||||
static final Encoding INSTANCE = new MacCyrillic();
|
||||
|
||||
private MacCyrillic() {
|
||||
super(NAME, LABELS);
|
||||
}
|
||||
|
||||
@Override public CharsetDecoder newDecoder() {
|
||||
return new InfallibleSingleByteDecoder(this, TABLE);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,184 @@
|
||||
/*
|
||||
* Copyright (c) 2013-2015 Mozilla Foundation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* THIS IS A GENERATED FILE. PLEASE DO NOT EDIT.
|
||||
* Instead, please regenerate using generate-encoding-data.py
|
||||
*/
|
||||
|
||||
package nu.validator.encoding;
|
||||
|
||||
import java.nio.charset.CharsetDecoder;
|
||||
|
||||
class Macintosh extends Encoding {
|
||||
|
||||
private static final char[] TABLE = {
|
||||
'\u00c4',
|
||||
'\u00c5',
|
||||
'\u00c7',
|
||||
'\u00c9',
|
||||
'\u00d1',
|
||||
'\u00d6',
|
||||
'\u00dc',
|
||||
'\u00e1',
|
||||
'\u00e0',
|
||||
'\u00e2',
|
||||
'\u00e4',
|
||||
'\u00e3',
|
||||
'\u00e5',
|
||||
'\u00e7',
|
||||
'\u00e9',
|
||||
'\u00e8',
|
||||
'\u00ea',
|
||||
'\u00eb',
|
||||
'\u00ed',
|
||||
'\u00ec',
|
||||
'\u00ee',
|
||||
'\u00ef',
|
||||
'\u00f1',
|
||||
'\u00f3',
|
||||
'\u00f2',
|
||||
'\u00f4',
|
||||
'\u00f6',
|
||||
'\u00f5',
|
||||
'\u00fa',
|
||||
'\u00f9',
|
||||
'\u00fb',
|
||||
'\u00fc',
|
||||
'\u2020',
|
||||
'\u00b0',
|
||||
'\u00a2',
|
||||
'\u00a3',
|
||||
'\u00a7',
|
||||
'\u2022',
|
||||
'\u00b6',
|
||||
'\u00df',
|
||||
'\u00ae',
|
||||
'\u00a9',
|
||||
'\u2122',
|
||||
'\u00b4',
|
||||
'\u00a8',
|
||||
'\u2260',
|
||||
'\u00c6',
|
||||
'\u00d8',
|
||||
'\u221e',
|
||||
'\u00b1',
|
||||
'\u2264',
|
||||
'\u2265',
|
||||
'\u00a5',
|
||||
'\u00b5',
|
||||
'\u2202',
|
||||
'\u2211',
|
||||
'\u220f',
|
||||
'\u03c0',
|
||||
'\u222b',
|
||||
'\u00aa',
|
||||
'\u00ba',
|
||||
'\u03a9',
|
||||
'\u00e6',
|
||||
'\u00f8',
|
||||
'\u00bf',
|
||||
'\u00a1',
|
||||
'\u00ac',
|
||||
'\u221a',
|
||||
'\u0192',
|
||||
'\u2248',
|
||||
'\u2206',
|
||||
'\u00ab',
|
||||
'\u00bb',
|
||||
'\u2026',
|
||||
'\u00a0',
|
||||
'\u00c0',
|
||||
'\u00c3',
|
||||
'\u00d5',
|
||||
'\u0152',
|
||||
'\u0153',
|
||||
'\u2013',
|
||||
'\u2014',
|
||||
'\u201c',
|
||||
'\u201d',
|
||||
'\u2018',
|
||||
'\u2019',
|
||||
'\u00f7',
|
||||
'\u25ca',
|
||||
'\u00ff',
|
||||
'\u0178',
|
||||
'\u2044',
|
||||
'\u20ac',
|
||||
'\u2039',
|
||||
'\u203a',
|
||||
'\ufb01',
|
||||
'\ufb02',
|
||||
'\u2021',
|
||||
'\u00b7',
|
||||
'\u201a',
|
||||
'\u201e',
|
||||
'\u2030',
|
||||
'\u00c2',
|
||||
'\u00ca',
|
||||
'\u00c1',
|
||||
'\u00cb',
|
||||
'\u00c8',
|
||||
'\u00cd',
|
||||
'\u00ce',
|
||||
'\u00cf',
|
||||
'\u00cc',
|
||||
'\u00d3',
|
||||
'\u00d4',
|
||||
'\uf8ff',
|
||||
'\u00d2',
|
||||
'\u00da',
|
||||
'\u00db',
|
||||
'\u00d9',
|
||||
'\u0131',
|
||||
'\u02c6',
|
||||
'\u02dc',
|
||||
'\u00af',
|
||||
'\u02d8',
|
||||
'\u02d9',
|
||||
'\u02da',
|
||||
'\u00b8',
|
||||
'\u02dd',
|
||||
'\u02db',
|
||||
'\u02c7'
|
||||
};
|
||||
|
||||
private static final String[] LABELS = {
|
||||
"csmacintosh",
|
||||
"mac",
|
||||
"macintosh",
|
||||
"x-mac-roman"
|
||||
};
|
||||
|
||||
private static final String NAME = "macintosh";
|
||||
|
||||
static final Encoding INSTANCE = new Macintosh();
|
||||
|
||||
private Macintosh() {
|
||||
super(NAME, LABELS);
|
||||
}
|
||||
|
||||
@Override public CharsetDecoder newDecoder() {
|
||||
return new InfallibleSingleByteDecoder(this, TABLE);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
/*
|
||||
* Copyright (c) 2013-2015 Mozilla Foundation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* THIS IS A GENERATED FILE. PLEASE DO NOT EDIT.
|
||||
* Instead, please regenerate using generate-encoding-data.py
|
||||
*/
|
||||
|
||||
package nu.validator.encoding;
|
||||
|
||||
import java.nio.charset.Charset;
|
||||
import java.nio.charset.CharsetDecoder;
|
||||
import java.nio.charset.CharsetEncoder;
|
||||
|
||||
class Replacement extends Encoding {
|
||||
|
||||
private static final String[] LABELS = {
|
||||
"csiso2022kr",
|
||||
"hz-gb-2312",
|
||||
"iso-2022-cn",
|
||||
"iso-2022-cn-ext",
|
||||
"iso-2022-kr"
|
||||
};
|
||||
|
||||
private static final String NAME = "replacement";
|
||||
|
||||
static final Replacement INSTANCE = new Replacement();
|
||||
|
||||
private Replacement() {
|
||||
super(NAME, LABELS);
|
||||
}
|
||||
|
||||
@Override public CharsetDecoder newDecoder() {
|
||||
return new ReplacementDecoder(this);
|
||||
}
|
||||
|
||||
@Override public CharsetEncoder newEncoder() {
|
||||
return Charset.forName(NAME).newEncoder();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
/*
|
||||
* Copyright (c) 2015 Mozilla Foundation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package nu.validator.encoding;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.CharBuffer;
|
||||
import java.nio.charset.Charset;
|
||||
import java.nio.charset.CoderResult;
|
||||
|
||||
class ReplacementDecoder extends Decoder {
|
||||
|
||||
private boolean haveEmitted = false;
|
||||
|
||||
ReplacementDecoder(Charset cs) {
|
||||
super(cs, 1.0f, 1.0f);
|
||||
}
|
||||
|
||||
@Override protected CoderResult decodeLoop(ByteBuffer in, CharBuffer out) {
|
||||
for (;;) {
|
||||
if (!in.hasRemaining()) {
|
||||
return CoderResult.UNDERFLOW;
|
||||
}
|
||||
if (haveEmitted) {
|
||||
in.position(in.limit());
|
||||
return CoderResult.UNDERFLOW;
|
||||
}
|
||||
if (!out.hasRemaining()) {
|
||||
return CoderResult.OVERFLOW;
|
||||
}
|
||||
in.position(in.limit());
|
||||
haveEmitted = true;
|
||||
if (this.report) {
|
||||
return CoderResult.malformedForLength(1);
|
||||
}
|
||||
out.put('\uFFFD');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @see java.nio.charset.CharsetDecoder#implFlush(java.nio.CharBuffer)
|
||||
*/
|
||||
@Override protected CoderResult implFlush(CharBuffer out) {
|
||||
// TODO Auto-generated method stub
|
||||
return super.implFlush(out);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see java.nio.charset.CharsetDecoder#implReset()
|
||||
*/
|
||||
@Override protected void implReset() {
|
||||
// TODO Auto-generated method stub
|
||||
super.implReset();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* Copyright (c) 2013-2015 Mozilla Foundation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* THIS IS A GENERATED FILE. PLEASE DO NOT EDIT.
|
||||
* Instead, please regenerate using generate-encoding-data.py
|
||||
*/
|
||||
|
||||
package nu.validator.encoding;
|
||||
|
||||
import java.nio.charset.Charset;
|
||||
import java.nio.charset.CharsetDecoder;
|
||||
import java.nio.charset.CharsetEncoder;
|
||||
|
||||
class ShiftJis extends Encoding {
|
||||
|
||||
private static final String[] LABELS = {
|
||||
"csshiftjis",
|
||||
"ms932",
|
||||
"ms_kanji",
|
||||
"shift-jis",
|
||||
"shift_jis",
|
||||
"sjis",
|
||||
"windows-31j",
|
||||
"x-sjis"
|
||||
};
|
||||
|
||||
private static final String NAME = "shift_jis";
|
||||
|
||||
static final ShiftJis INSTANCE = new ShiftJis();
|
||||
|
||||
private ShiftJis() {
|
||||
super(NAME, LABELS);
|
||||
}
|
||||
|
||||
@Override public CharsetDecoder newDecoder() {
|
||||
return Charset.forName(NAME).newDecoder();
|
||||
}
|
||||
|
||||
@Override public CharsetEncoder newEncoder() {
|
||||
return Charset.forName(NAME).newEncoder();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
/*
|
||||
* Copyright (c) 2013-2015 Mozilla Foundation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* THIS IS A GENERATED FILE. PLEASE DO NOT EDIT.
|
||||
* Instead, please regenerate using generate-encoding-data.py
|
||||
*/
|
||||
|
||||
package nu.validator.encoding;
|
||||
|
||||
import java.nio.charset.Charset;
|
||||
import java.nio.charset.CharsetDecoder;
|
||||
import java.nio.charset.CharsetEncoder;
|
||||
|
||||
class UserDefined extends Encoding {
|
||||
|
||||
private static final String[] LABELS = {
|
||||
"x-user-defined"
|
||||
};
|
||||
|
||||
private static final String NAME = "x-user-defined";
|
||||
|
||||
static final UserDefined INSTANCE = new UserDefined();
|
||||
|
||||
private UserDefined() {
|
||||
super(NAME, LABELS);
|
||||
}
|
||||
|
||||
@Override public CharsetDecoder newDecoder() {
|
||||
return new UserDefinedDecoder(this);
|
||||
}
|
||||
|
||||
@Override public CharsetEncoder newEncoder() {
|
||||
return Charset.forName(NAME).newEncoder();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
/*
|
||||
* Copyright (c) 2013-2015 Mozilla Foundation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package nu.validator.encoding;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.CharBuffer;
|
||||
import java.nio.charset.Charset;
|
||||
import java.nio.charset.CharsetDecoder;
|
||||
import java.nio.charset.CoderResult;
|
||||
|
||||
class UserDefinedDecoder extends Decoder {
|
||||
|
||||
UserDefinedDecoder(Charset cs) {
|
||||
super(cs, 1.0f, 1.0f);
|
||||
}
|
||||
|
||||
@Override protected CoderResult decodeLoop(ByteBuffer in, CharBuffer out) {
|
||||
// TODO figure out if it's worthwhile to optimize the case where both
|
||||
// buffers are array-backed.
|
||||
for (;;) {
|
||||
if (!in.hasRemaining()) {
|
||||
return CoderResult.UNDERFLOW;
|
||||
}
|
||||
if (!out.hasRemaining()) {
|
||||
return CoderResult.OVERFLOW;
|
||||
}
|
||||
int b = (int)in.get();
|
||||
if (b >= 0) {
|
||||
out.put((char)b);
|
||||
} else {
|
||||
out.put((char)(b + 128 + 0xF780));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
/*
|
||||
* Copyright (c) 2013-2015 Mozilla Foundation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* THIS IS A GENERATED FILE. PLEASE DO NOT EDIT.
|
||||
* Instead, please regenerate using generate-encoding-data.py
|
||||
*/
|
||||
|
||||
package nu.validator.encoding;
|
||||
|
||||
import java.nio.charset.Charset;
|
||||
import java.nio.charset.CharsetDecoder;
|
||||
import java.nio.charset.CharsetEncoder;
|
||||
|
||||
class Utf16Be extends Encoding {
|
||||
|
||||
private static final String[] LABELS = {
|
||||
"utf-16be"
|
||||
};
|
||||
|
||||
private static final String NAME = "utf-16be";
|
||||
|
||||
static final Utf16Be INSTANCE = new Utf16Be();
|
||||
|
||||
private Utf16Be() {
|
||||
super(NAME, LABELS);
|
||||
}
|
||||
|
||||
@Override public CharsetDecoder newDecoder() {
|
||||
return Charset.forName(NAME).newDecoder();
|
||||
}
|
||||
|
||||
@Override public CharsetEncoder newEncoder() {
|
||||
return Charset.forName(NAME).newEncoder();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
/*
|
||||
* Copyright (c) 2013-2015 Mozilla Foundation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* THIS IS A GENERATED FILE. PLEASE DO NOT EDIT.
|
||||
* Instead, please regenerate using generate-encoding-data.py
|
||||
*/
|
||||
|
||||
package nu.validator.encoding;
|
||||
|
||||
import java.nio.charset.Charset;
|
||||
import java.nio.charset.CharsetDecoder;
|
||||
import java.nio.charset.CharsetEncoder;
|
||||
|
||||
class Utf16Le extends Encoding {
|
||||
|
||||
private static final String[] LABELS = {
|
||||
"utf-16",
|
||||
"utf-16le"
|
||||
};
|
||||
|
||||
private static final String NAME = "utf-16le";
|
||||
|
||||
static final Utf16Le INSTANCE = new Utf16Le();
|
||||
|
||||
private Utf16Le() {
|
||||
super(NAME, LABELS);
|
||||
}
|
||||
|
||||
@Override public CharsetDecoder newDecoder() {
|
||||
return Charset.forName(NAME).newDecoder();
|
||||
}
|
||||
|
||||
@Override public CharsetEncoder newEncoder() {
|
||||
return Charset.forName(NAME).newEncoder();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
/*
|
||||
* Copyright (c) 2013-2015 Mozilla Foundation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* THIS IS A GENERATED FILE. PLEASE DO NOT EDIT.
|
||||
* Instead, please regenerate using generate-encoding-data.py
|
||||
*/
|
||||
|
||||
package nu.validator.encoding;
|
||||
|
||||
import java.nio.charset.Charset;
|
||||
import java.nio.charset.CharsetDecoder;
|
||||
import java.nio.charset.CharsetEncoder;
|
||||
|
||||
class Utf8 extends Encoding {
|
||||
|
||||
private static final String[] LABELS = {
|
||||
"unicode-1-1-utf-8",
|
||||
"utf-8",
|
||||
"utf8"
|
||||
};
|
||||
|
||||
private static final String NAME = "utf-8";
|
||||
|
||||
static final Utf8 INSTANCE = new Utf8();
|
||||
|
||||
private Utf8() {
|
||||
super(NAME, LABELS);
|
||||
}
|
||||
|
||||
@Override public CharsetDecoder newDecoder() {
|
||||
return Charset.forName(NAME).newDecoder();
|
||||
}
|
||||
|
||||
@Override public CharsetEncoder newEncoder() {
|
||||
return Charset.forName(NAME).newEncoder();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,183 @@
|
||||
/*
|
||||
* Copyright (c) 2013-2015 Mozilla Foundation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* THIS IS A GENERATED FILE. PLEASE DO NOT EDIT.
|
||||
* Instead, please regenerate using generate-encoding-data.py
|
||||
*/
|
||||
|
||||
package nu.validator.encoding;
|
||||
|
||||
import java.nio.charset.CharsetDecoder;
|
||||
|
||||
class Windows1250 extends Encoding {
|
||||
|
||||
private static final char[] TABLE = {
|
||||
'\u20ac',
|
||||
'\u0081',
|
||||
'\u201a',
|
||||
'\u0083',
|
||||
'\u201e',
|
||||
'\u2026',
|
||||
'\u2020',
|
||||
'\u2021',
|
||||
'\u0088',
|
||||
'\u2030',
|
||||
'\u0160',
|
||||
'\u2039',
|
||||
'\u015a',
|
||||
'\u0164',
|
||||
'\u017d',
|
||||
'\u0179',
|
||||
'\u0090',
|
||||
'\u2018',
|
||||
'\u2019',
|
||||
'\u201c',
|
||||
'\u201d',
|
||||
'\u2022',
|
||||
'\u2013',
|
||||
'\u2014',
|
||||
'\u0098',
|
||||
'\u2122',
|
||||
'\u0161',
|
||||
'\u203a',
|
||||
'\u015b',
|
||||
'\u0165',
|
||||
'\u017e',
|
||||
'\u017a',
|
||||
'\u00a0',
|
||||
'\u02c7',
|
||||
'\u02d8',
|
||||
'\u0141',
|
||||
'\u00a4',
|
||||
'\u0104',
|
||||
'\u00a6',
|
||||
'\u00a7',
|
||||
'\u00a8',
|
||||
'\u00a9',
|
||||
'\u015e',
|
||||
'\u00ab',
|
||||
'\u00ac',
|
||||
'\u00ad',
|
||||
'\u00ae',
|
||||
'\u017b',
|
||||
'\u00b0',
|
||||
'\u00b1',
|
||||
'\u02db',
|
||||
'\u0142',
|
||||
'\u00b4',
|
||||
'\u00b5',
|
||||
'\u00b6',
|
||||
'\u00b7',
|
||||
'\u00b8',
|
||||
'\u0105',
|
||||
'\u015f',
|
||||
'\u00bb',
|
||||
'\u013d',
|
||||
'\u02dd',
|
||||
'\u013e',
|
||||
'\u017c',
|
||||
'\u0154',
|
||||
'\u00c1',
|
||||
'\u00c2',
|
||||
'\u0102',
|
||||
'\u00c4',
|
||||
'\u0139',
|
||||
'\u0106',
|
||||
'\u00c7',
|
||||
'\u010c',
|
||||
'\u00c9',
|
||||
'\u0118',
|
||||
'\u00cb',
|
||||
'\u011a',
|
||||
'\u00cd',
|
||||
'\u00ce',
|
||||
'\u010e',
|
||||
'\u0110',
|
||||
'\u0143',
|
||||
'\u0147',
|
||||
'\u00d3',
|
||||
'\u00d4',
|
||||
'\u0150',
|
||||
'\u00d6',
|
||||
'\u00d7',
|
||||
'\u0158',
|
||||
'\u016e',
|
||||
'\u00da',
|
||||
'\u0170',
|
||||
'\u00dc',
|
||||
'\u00dd',
|
||||
'\u0162',
|
||||
'\u00df',
|
||||
'\u0155',
|
||||
'\u00e1',
|
||||
'\u00e2',
|
||||
'\u0103',
|
||||
'\u00e4',
|
||||
'\u013a',
|
||||
'\u0107',
|
||||
'\u00e7',
|
||||
'\u010d',
|
||||
'\u00e9',
|
||||
'\u0119',
|
||||
'\u00eb',
|
||||
'\u011b',
|
||||
'\u00ed',
|
||||
'\u00ee',
|
||||
'\u010f',
|
||||
'\u0111',
|
||||
'\u0144',
|
||||
'\u0148',
|
||||
'\u00f3',
|
||||
'\u00f4',
|
||||
'\u0151',
|
||||
'\u00f6',
|
||||
'\u00f7',
|
||||
'\u0159',
|
||||
'\u016f',
|
||||
'\u00fa',
|
||||
'\u0171',
|
||||
'\u00fc',
|
||||
'\u00fd',
|
||||
'\u0163',
|
||||
'\u02d9'
|
||||
};
|
||||
|
||||
private static final String[] LABELS = {
|
||||
"cp1250",
|
||||
"windows-1250",
|
||||
"x-cp1250"
|
||||
};
|
||||
|
||||
private static final String NAME = "windows-1250";
|
||||
|
||||
static final Encoding INSTANCE = new Windows1250();
|
||||
|
||||
private Windows1250() {
|
||||
super(NAME, LABELS);
|
||||
}
|
||||
|
||||
@Override public CharsetDecoder newDecoder() {
|
||||
return new InfallibleSingleByteDecoder(this, TABLE);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,183 @@
|
||||
/*
|
||||
* Copyright (c) 2013-2015 Mozilla Foundation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* THIS IS A GENERATED FILE. PLEASE DO NOT EDIT.
|
||||
* Instead, please regenerate using generate-encoding-data.py
|
||||
*/
|
||||
|
||||
package nu.validator.encoding;
|
||||
|
||||
import java.nio.charset.CharsetDecoder;
|
||||
|
||||
class Windows1251 extends Encoding {
|
||||
|
||||
private static final char[] TABLE = {
|
||||
'\u0402',
|
||||
'\u0403',
|
||||
'\u201a',
|
||||
'\u0453',
|
||||
'\u201e',
|
||||
'\u2026',
|
||||
'\u2020',
|
||||
'\u2021',
|
||||
'\u20ac',
|
||||
'\u2030',
|
||||
'\u0409',
|
||||
'\u2039',
|
||||
'\u040a',
|
||||
'\u040c',
|
||||
'\u040b',
|
||||
'\u040f',
|
||||
'\u0452',
|
||||
'\u2018',
|
||||
'\u2019',
|
||||
'\u201c',
|
||||
'\u201d',
|
||||
'\u2022',
|
||||
'\u2013',
|
||||
'\u2014',
|
||||
'\u0098',
|
||||
'\u2122',
|
||||
'\u0459',
|
||||
'\u203a',
|
||||
'\u045a',
|
||||
'\u045c',
|
||||
'\u045b',
|
||||
'\u045f',
|
||||
'\u00a0',
|
||||
'\u040e',
|
||||
'\u045e',
|
||||
'\u0408',
|
||||
'\u00a4',
|
||||
'\u0490',
|
||||
'\u00a6',
|
||||
'\u00a7',
|
||||
'\u0401',
|
||||
'\u00a9',
|
||||
'\u0404',
|
||||
'\u00ab',
|
||||
'\u00ac',
|
||||
'\u00ad',
|
||||
'\u00ae',
|
||||
'\u0407',
|
||||
'\u00b0',
|
||||
'\u00b1',
|
||||
'\u0406',
|
||||
'\u0456',
|
||||
'\u0491',
|
||||
'\u00b5',
|
||||
'\u00b6',
|
||||
'\u00b7',
|
||||
'\u0451',
|
||||
'\u2116',
|
||||
'\u0454',
|
||||
'\u00bb',
|
||||
'\u0458',
|
||||
'\u0405',
|
||||
'\u0455',
|
||||
'\u0457',
|
||||
'\u0410',
|
||||
'\u0411',
|
||||
'\u0412',
|
||||
'\u0413',
|
||||
'\u0414',
|
||||
'\u0415',
|
||||
'\u0416',
|
||||
'\u0417',
|
||||
'\u0418',
|
||||
'\u0419',
|
||||
'\u041a',
|
||||
'\u041b',
|
||||
'\u041c',
|
||||
'\u041d',
|
||||
'\u041e',
|
||||
'\u041f',
|
||||
'\u0420',
|
||||
'\u0421',
|
||||
'\u0422',
|
||||
'\u0423',
|
||||
'\u0424',
|
||||
'\u0425',
|
||||
'\u0426',
|
||||
'\u0427',
|
||||
'\u0428',
|
||||
'\u0429',
|
||||
'\u042a',
|
||||
'\u042b',
|
||||
'\u042c',
|
||||
'\u042d',
|
||||
'\u042e',
|
||||
'\u042f',
|
||||
'\u0430',
|
||||
'\u0431',
|
||||
'\u0432',
|
||||
'\u0433',
|
||||
'\u0434',
|
||||
'\u0435',
|
||||
'\u0436',
|
||||
'\u0437',
|
||||
'\u0438',
|
||||
'\u0439',
|
||||
'\u043a',
|
||||
'\u043b',
|
||||
'\u043c',
|
||||
'\u043d',
|
||||
'\u043e',
|
||||
'\u043f',
|
||||
'\u0440',
|
||||
'\u0441',
|
||||
'\u0442',
|
||||
'\u0443',
|
||||
'\u0444',
|
||||
'\u0445',
|
||||
'\u0446',
|
||||
'\u0447',
|
||||
'\u0448',
|
||||
'\u0449',
|
||||
'\u044a',
|
||||
'\u044b',
|
||||
'\u044c',
|
||||
'\u044d',
|
||||
'\u044e',
|
||||
'\u044f'
|
||||
};
|
||||
|
||||
private static final String[] LABELS = {
|
||||
"cp1251",
|
||||
"windows-1251",
|
||||
"x-cp1251"
|
||||
};
|
||||
|
||||
private static final String NAME = "windows-1251";
|
||||
|
||||
static final Encoding INSTANCE = new Windows1251();
|
||||
|
||||
private Windows1251() {
|
||||
super(NAME, LABELS);
|
||||
}
|
||||
|
||||
@Override public CharsetDecoder newDecoder() {
|
||||
return new InfallibleSingleByteDecoder(this, TABLE);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,197 @@
|
||||
/*
|
||||
* Copyright (c) 2013-2015 Mozilla Foundation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* THIS IS A GENERATED FILE. PLEASE DO NOT EDIT.
|
||||
* Instead, please regenerate using generate-encoding-data.py
|
||||
*/
|
||||
|
||||
package nu.validator.encoding;
|
||||
|
||||
import java.nio.charset.CharsetDecoder;
|
||||
|
||||
class Windows1252 extends Encoding {
|
||||
|
||||
private static final char[] TABLE = {
|
||||
'\u20ac',
|
||||
'\u0081',
|
||||
'\u201a',
|
||||
'\u0192',
|
||||
'\u201e',
|
||||
'\u2026',
|
||||
'\u2020',
|
||||
'\u2021',
|
||||
'\u02c6',
|
||||
'\u2030',
|
||||
'\u0160',
|
||||
'\u2039',
|
||||
'\u0152',
|
||||
'\u008d',
|
||||
'\u017d',
|
||||
'\u008f',
|
||||
'\u0090',
|
||||
'\u2018',
|
||||
'\u2019',
|
||||
'\u201c',
|
||||
'\u201d',
|
||||
'\u2022',
|
||||
'\u2013',
|
||||
'\u2014',
|
||||
'\u02dc',
|
||||
'\u2122',
|
||||
'\u0161',
|
||||
'\u203a',
|
||||
'\u0153',
|
||||
'\u009d',
|
||||
'\u017e',
|
||||
'\u0178',
|
||||
'\u00a0',
|
||||
'\u00a1',
|
||||
'\u00a2',
|
||||
'\u00a3',
|
||||
'\u00a4',
|
||||
'\u00a5',
|
||||
'\u00a6',
|
||||
'\u00a7',
|
||||
'\u00a8',
|
||||
'\u00a9',
|
||||
'\u00aa',
|
||||
'\u00ab',
|
||||
'\u00ac',
|
||||
'\u00ad',
|
||||
'\u00ae',
|
||||
'\u00af',
|
||||
'\u00b0',
|
||||
'\u00b1',
|
||||
'\u00b2',
|
||||
'\u00b3',
|
||||
'\u00b4',
|
||||
'\u00b5',
|
||||
'\u00b6',
|
||||
'\u00b7',
|
||||
'\u00b8',
|
||||
'\u00b9',
|
||||
'\u00ba',
|
||||
'\u00bb',
|
||||
'\u00bc',
|
||||
'\u00bd',
|
||||
'\u00be',
|
||||
'\u00bf',
|
||||
'\u00c0',
|
||||
'\u00c1',
|
||||
'\u00c2',
|
||||
'\u00c3',
|
||||
'\u00c4',
|
||||
'\u00c5',
|
||||
'\u00c6',
|
||||
'\u00c7',
|
||||
'\u00c8',
|
||||
'\u00c9',
|
||||
'\u00ca',
|
||||
'\u00cb',
|
||||
'\u00cc',
|
||||
'\u00cd',
|
||||
'\u00ce',
|
||||
'\u00cf',
|
||||
'\u00d0',
|
||||
'\u00d1',
|
||||
'\u00d2',
|
||||
'\u00d3',
|
||||
'\u00d4',
|
||||
'\u00d5',
|
||||
'\u00d6',
|
||||
'\u00d7',
|
||||
'\u00d8',
|
||||
'\u00d9',
|
||||
'\u00da',
|
||||
'\u00db',
|
||||
'\u00dc',
|
||||
'\u00dd',
|
||||
'\u00de',
|
||||
'\u00df',
|
||||
'\u00e0',
|
||||
'\u00e1',
|
||||
'\u00e2',
|
||||
'\u00e3',
|
||||
'\u00e4',
|
||||
'\u00e5',
|
||||
'\u00e6',
|
||||
'\u00e7',
|
||||
'\u00e8',
|
||||
'\u00e9',
|
||||
'\u00ea',
|
||||
'\u00eb',
|
||||
'\u00ec',
|
||||
'\u00ed',
|
||||
'\u00ee',
|
||||
'\u00ef',
|
||||
'\u00f0',
|
||||
'\u00f1',
|
||||
'\u00f2',
|
||||
'\u00f3',
|
||||
'\u00f4',
|
||||
'\u00f5',
|
||||
'\u00f6',
|
||||
'\u00f7',
|
||||
'\u00f8',
|
||||
'\u00f9',
|
||||
'\u00fa',
|
||||
'\u00fb',
|
||||
'\u00fc',
|
||||
'\u00fd',
|
||||
'\u00fe',
|
||||
'\u00ff'
|
||||
};
|
||||
|
||||
private static final String[] LABELS = {
|
||||
"ansi_x3.4-1968",
|
||||
"ascii",
|
||||
"cp1252",
|
||||
"cp819",
|
||||
"csisolatin1",
|
||||
"ibm819",
|
||||
"iso-8859-1",
|
||||
"iso-ir-100",
|
||||
"iso8859-1",
|
||||
"iso88591",
|
||||
"iso_8859-1",
|
||||
"iso_8859-1:1987",
|
||||
"l1",
|
||||
"latin1",
|
||||
"us-ascii",
|
||||
"windows-1252",
|
||||
"x-cp1252"
|
||||
};
|
||||
|
||||
private static final String NAME = "windows-1252";
|
||||
|
||||
static final Encoding INSTANCE = new Windows1252();
|
||||
|
||||
private Windows1252() {
|
||||
super(NAME, LABELS);
|
||||
}
|
||||
|
||||
@Override public CharsetDecoder newDecoder() {
|
||||
return new InfallibleSingleByteDecoder(this, TABLE);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,183 @@
|
||||
/*
|
||||
* Copyright (c) 2013-2015 Mozilla Foundation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* THIS IS A GENERATED FILE. PLEASE DO NOT EDIT.
|
||||
* Instead, please regenerate using generate-encoding-data.py
|
||||
*/
|
||||
|
||||
package nu.validator.encoding;
|
||||
|
||||
import java.nio.charset.CharsetDecoder;
|
||||
|
||||
class Windows1253 extends Encoding {
|
||||
|
||||
private static final char[] TABLE = {
|
||||
'\u20ac',
|
||||
'\u0081',
|
||||
'\u201a',
|
||||
'\u0192',
|
||||
'\u201e',
|
||||
'\u2026',
|
||||
'\u2020',
|
||||
'\u2021',
|
||||
'\u0088',
|
||||
'\u2030',
|
||||
'\u008a',
|
||||
'\u2039',
|
||||
'\u008c',
|
||||
'\u008d',
|
||||
'\u008e',
|
||||
'\u008f',
|
||||
'\u0090',
|
||||
'\u2018',
|
||||
'\u2019',
|
||||
'\u201c',
|
||||
'\u201d',
|
||||
'\u2022',
|
||||
'\u2013',
|
||||
'\u2014',
|
||||
'\u0098',
|
||||
'\u2122',
|
||||
'\u009a',
|
||||
'\u203a',
|
||||
'\u009c',
|
||||
'\u009d',
|
||||
'\u009e',
|
||||
'\u009f',
|
||||
'\u00a0',
|
||||
'\u0385',
|
||||
'\u0386',
|
||||
'\u00a3',
|
||||
'\u00a4',
|
||||
'\u00a5',
|
||||
'\u00a6',
|
||||
'\u00a7',
|
||||
'\u00a8',
|
||||
'\u00a9',
|
||||
'\ufffd',
|
||||
'\u00ab',
|
||||
'\u00ac',
|
||||
'\u00ad',
|
||||
'\u00ae',
|
||||
'\u2015',
|
||||
'\u00b0',
|
||||
'\u00b1',
|
||||
'\u00b2',
|
||||
'\u00b3',
|
||||
'\u0384',
|
||||
'\u00b5',
|
||||
'\u00b6',
|
||||
'\u00b7',
|
||||
'\u0388',
|
||||
'\u0389',
|
||||
'\u038a',
|
||||
'\u00bb',
|
||||
'\u038c',
|
||||
'\u00bd',
|
||||
'\u038e',
|
||||
'\u038f',
|
||||
'\u0390',
|
||||
'\u0391',
|
||||
'\u0392',
|
||||
'\u0393',
|
||||
'\u0394',
|
||||
'\u0395',
|
||||
'\u0396',
|
||||
'\u0397',
|
||||
'\u0398',
|
||||
'\u0399',
|
||||
'\u039a',
|
||||
'\u039b',
|
||||
'\u039c',
|
||||
'\u039d',
|
||||
'\u039e',
|
||||
'\u039f',
|
||||
'\u03a0',
|
||||
'\u03a1',
|
||||
'\ufffd',
|
||||
'\u03a3',
|
||||
'\u03a4',
|
||||
'\u03a5',
|
||||
'\u03a6',
|
||||
'\u03a7',
|
||||
'\u03a8',
|
||||
'\u03a9',
|
||||
'\u03aa',
|
||||
'\u03ab',
|
||||
'\u03ac',
|
||||
'\u03ad',
|
||||
'\u03ae',
|
||||
'\u03af',
|
||||
'\u03b0',
|
||||
'\u03b1',
|
||||
'\u03b2',
|
||||
'\u03b3',
|
||||
'\u03b4',
|
||||
'\u03b5',
|
||||
'\u03b6',
|
||||
'\u03b7',
|
||||
'\u03b8',
|
||||
'\u03b9',
|
||||
'\u03ba',
|
||||
'\u03bb',
|
||||
'\u03bc',
|
||||
'\u03bd',
|
||||
'\u03be',
|
||||
'\u03bf',
|
||||
'\u03c0',
|
||||
'\u03c1',
|
||||
'\u03c2',
|
||||
'\u03c3',
|
||||
'\u03c4',
|
||||
'\u03c5',
|
||||
'\u03c6',
|
||||
'\u03c7',
|
||||
'\u03c8',
|
||||
'\u03c9',
|
||||
'\u03ca',
|
||||
'\u03cb',
|
||||
'\u03cc',
|
||||
'\u03cd',
|
||||
'\u03ce',
|
||||
'\ufffd'
|
||||
};
|
||||
|
||||
private static final String[] LABELS = {
|
||||
"cp1253",
|
||||
"windows-1253",
|
||||
"x-cp1253"
|
||||
};
|
||||
|
||||
private static final String NAME = "windows-1253";
|
||||
|
||||
static final Encoding INSTANCE = new Windows1253();
|
||||
|
||||
private Windows1253() {
|
||||
super(NAME, LABELS);
|
||||
}
|
||||
|
||||
@Override public CharsetDecoder newDecoder() {
|
||||
return new FallibleSingleByteDecoder(this, TABLE);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,192 @@
|
||||
/*
|
||||
* Copyright (c) 2013-2015 Mozilla Foundation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* THIS IS A GENERATED FILE. PLEASE DO NOT EDIT.
|
||||
* Instead, please regenerate using generate-encoding-data.py
|
||||
*/
|
||||
|
||||
package nu.validator.encoding;
|
||||
|
||||
import java.nio.charset.CharsetDecoder;
|
||||
|
||||
class Windows1254 extends Encoding {
|
||||
|
||||
private static final char[] TABLE = {
|
||||
'\u20ac',
|
||||
'\u0081',
|
||||
'\u201a',
|
||||
'\u0192',
|
||||
'\u201e',
|
||||
'\u2026',
|
||||
'\u2020',
|
||||
'\u2021',
|
||||
'\u02c6',
|
||||
'\u2030',
|
||||
'\u0160',
|
||||
'\u2039',
|
||||
'\u0152',
|
||||
'\u008d',
|
||||
'\u008e',
|
||||
'\u008f',
|
||||
'\u0090',
|
||||
'\u2018',
|
||||
'\u2019',
|
||||
'\u201c',
|
||||
'\u201d',
|
||||
'\u2022',
|
||||
'\u2013',
|
||||
'\u2014',
|
||||
'\u02dc',
|
||||
'\u2122',
|
||||
'\u0161',
|
||||
'\u203a',
|
||||
'\u0153',
|
||||
'\u009d',
|
||||
'\u009e',
|
||||
'\u0178',
|
||||
'\u00a0',
|
||||
'\u00a1',
|
||||
'\u00a2',
|
||||
'\u00a3',
|
||||
'\u00a4',
|
||||
'\u00a5',
|
||||
'\u00a6',
|
||||
'\u00a7',
|
||||
'\u00a8',
|
||||
'\u00a9',
|
||||
'\u00aa',
|
||||
'\u00ab',
|
||||
'\u00ac',
|
||||
'\u00ad',
|
||||
'\u00ae',
|
||||
'\u00af',
|
||||
'\u00b0',
|
||||
'\u00b1',
|
||||
'\u00b2',
|
||||
'\u00b3',
|
||||
'\u00b4',
|
||||
'\u00b5',
|
||||
'\u00b6',
|
||||
'\u00b7',
|
||||
'\u00b8',
|
||||
'\u00b9',
|
||||
'\u00ba',
|
||||
'\u00bb',
|
||||
'\u00bc',
|
||||
'\u00bd',
|
||||
'\u00be',
|
||||
'\u00bf',
|
||||
'\u00c0',
|
||||
'\u00c1',
|
||||
'\u00c2',
|
||||
'\u00c3',
|
||||
'\u00c4',
|
||||
'\u00c5',
|
||||
'\u00c6',
|
||||
'\u00c7',
|
||||
'\u00c8',
|
||||
'\u00c9',
|
||||
'\u00ca',
|
||||
'\u00cb',
|
||||
'\u00cc',
|
||||
'\u00cd',
|
||||
'\u00ce',
|
||||
'\u00cf',
|
||||
'\u011e',
|
||||
'\u00d1',
|
||||
'\u00d2',
|
||||
'\u00d3',
|
||||
'\u00d4',
|
||||
'\u00d5',
|
||||
'\u00d6',
|
||||
'\u00d7',
|
||||
'\u00d8',
|
||||
'\u00d9',
|
||||
'\u00da',
|
||||
'\u00db',
|
||||
'\u00dc',
|
||||
'\u0130',
|
||||
'\u015e',
|
||||
'\u00df',
|
||||
'\u00e0',
|
||||
'\u00e1',
|
||||
'\u00e2',
|
||||
'\u00e3',
|
||||
'\u00e4',
|
||||
'\u00e5',
|
||||
'\u00e6',
|
||||
'\u00e7',
|
||||
'\u00e8',
|
||||
'\u00e9',
|
||||
'\u00ea',
|
||||
'\u00eb',
|
||||
'\u00ec',
|
||||
'\u00ed',
|
||||
'\u00ee',
|
||||
'\u00ef',
|
||||
'\u011f',
|
||||
'\u00f1',
|
||||
'\u00f2',
|
||||
'\u00f3',
|
||||
'\u00f4',
|
||||
'\u00f5',
|
||||
'\u00f6',
|
||||
'\u00f7',
|
||||
'\u00f8',
|
||||
'\u00f9',
|
||||
'\u00fa',
|
||||
'\u00fb',
|
||||
'\u00fc',
|
||||
'\u0131',
|
||||
'\u015f',
|
||||
'\u00ff'
|
||||
};
|
||||
|
||||
private static final String[] LABELS = {
|
||||
"cp1254",
|
||||
"csisolatin5",
|
||||
"iso-8859-9",
|
||||
"iso-ir-148",
|
||||
"iso8859-9",
|
||||
"iso88599",
|
||||
"iso_8859-9",
|
||||
"iso_8859-9:1989",
|
||||
"l5",
|
||||
"latin5",
|
||||
"windows-1254",
|
||||
"x-cp1254"
|
||||
};
|
||||
|
||||
private static final String NAME = "windows-1254";
|
||||
|
||||
static final Encoding INSTANCE = new Windows1254();
|
||||
|
||||
private Windows1254() {
|
||||
super(NAME, LABELS);
|
||||
}
|
||||
|
||||
@Override public CharsetDecoder newDecoder() {
|
||||
return new InfallibleSingleByteDecoder(this, TABLE);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,183 @@
|
||||
/*
|
||||
* Copyright (c) 2013-2015 Mozilla Foundation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* THIS IS A GENERATED FILE. PLEASE DO NOT EDIT.
|
||||
* Instead, please regenerate using generate-encoding-data.py
|
||||
*/
|
||||
|
||||
package nu.validator.encoding;
|
||||
|
||||
import java.nio.charset.CharsetDecoder;
|
||||
|
||||
class Windows1255 extends Encoding {
|
||||
|
||||
private static final char[] TABLE = {
|
||||
'\u20ac',
|
||||
'\u0081',
|
||||
'\u201a',
|
||||
'\u0192',
|
||||
'\u201e',
|
||||
'\u2026',
|
||||
'\u2020',
|
||||
'\u2021',
|
||||
'\u02c6',
|
||||
'\u2030',
|
||||
'\u008a',
|
||||
'\u2039',
|
||||
'\u008c',
|
||||
'\u008d',
|
||||
'\u008e',
|
||||
'\u008f',
|
||||
'\u0090',
|
||||
'\u2018',
|
||||
'\u2019',
|
||||
'\u201c',
|
||||
'\u201d',
|
||||
'\u2022',
|
||||
'\u2013',
|
||||
'\u2014',
|
||||
'\u02dc',
|
||||
'\u2122',
|
||||
'\u009a',
|
||||
'\u203a',
|
||||
'\u009c',
|
||||
'\u009d',
|
||||
'\u009e',
|
||||
'\u009f',
|
||||
'\u00a0',
|
||||
'\u00a1',
|
||||
'\u00a2',
|
||||
'\u00a3',
|
||||
'\u20aa',
|
||||
'\u00a5',
|
||||
'\u00a6',
|
||||
'\u00a7',
|
||||
'\u00a8',
|
||||
'\u00a9',
|
||||
'\u00d7',
|
||||
'\u00ab',
|
||||
'\u00ac',
|
||||
'\u00ad',
|
||||
'\u00ae',
|
||||
'\u00af',
|
||||
'\u00b0',
|
||||
'\u00b1',
|
||||
'\u00b2',
|
||||
'\u00b3',
|
||||
'\u00b4',
|
||||
'\u00b5',
|
||||
'\u00b6',
|
||||
'\u00b7',
|
||||
'\u00b8',
|
||||
'\u00b9',
|
||||
'\u00f7',
|
||||
'\u00bb',
|
||||
'\u00bc',
|
||||
'\u00bd',
|
||||
'\u00be',
|
||||
'\u00bf',
|
||||
'\u05b0',
|
||||
'\u05b1',
|
||||
'\u05b2',
|
||||
'\u05b3',
|
||||
'\u05b4',
|
||||
'\u05b5',
|
||||
'\u05b6',
|
||||
'\u05b7',
|
||||
'\u05b8',
|
||||
'\u05b9',
|
||||
'\ufffd',
|
||||
'\u05bb',
|
||||
'\u05bc',
|
||||
'\u05bd',
|
||||
'\u05be',
|
||||
'\u05bf',
|
||||
'\u05c0',
|
||||
'\u05c1',
|
||||
'\u05c2',
|
||||
'\u05c3',
|
||||
'\u05f0',
|
||||
'\u05f1',
|
||||
'\u05f2',
|
||||
'\u05f3',
|
||||
'\u05f4',
|
||||
'\ufffd',
|
||||
'\ufffd',
|
||||
'\ufffd',
|
||||
'\ufffd',
|
||||
'\ufffd',
|
||||
'\ufffd',
|
||||
'\ufffd',
|
||||
'\u05d0',
|
||||
'\u05d1',
|
||||
'\u05d2',
|
||||
'\u05d3',
|
||||
'\u05d4',
|
||||
'\u05d5',
|
||||
'\u05d6',
|
||||
'\u05d7',
|
||||
'\u05d8',
|
||||
'\u05d9',
|
||||
'\u05da',
|
||||
'\u05db',
|
||||
'\u05dc',
|
||||
'\u05dd',
|
||||
'\u05de',
|
||||
'\u05df',
|
||||
'\u05e0',
|
||||
'\u05e1',
|
||||
'\u05e2',
|
||||
'\u05e3',
|
||||
'\u05e4',
|
||||
'\u05e5',
|
||||
'\u05e6',
|
||||
'\u05e7',
|
||||
'\u05e8',
|
||||
'\u05e9',
|
||||
'\u05ea',
|
||||
'\ufffd',
|
||||
'\ufffd',
|
||||
'\u200e',
|
||||
'\u200f',
|
||||
'\ufffd'
|
||||
};
|
||||
|
||||
private static final String[] LABELS = {
|
||||
"cp1255",
|
||||
"windows-1255",
|
||||
"x-cp1255"
|
||||
};
|
||||
|
||||
private static final String NAME = "windows-1255";
|
||||
|
||||
static final Encoding INSTANCE = new Windows1255();
|
||||
|
||||
private Windows1255() {
|
||||
super(NAME, LABELS);
|
||||
}
|
||||
|
||||
@Override public CharsetDecoder newDecoder() {
|
||||
return new FallibleSingleByteDecoder(this, TABLE);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,183 @@
|
||||
/*
|
||||
* Copyright (c) 2013-2015 Mozilla Foundation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* THIS IS A GENERATED FILE. PLEASE DO NOT EDIT.
|
||||
* Instead, please regenerate using generate-encoding-data.py
|
||||
*/
|
||||
|
||||
package nu.validator.encoding;
|
||||
|
||||
import java.nio.charset.CharsetDecoder;
|
||||
|
||||
class Windows1256 extends Encoding {
|
||||
|
||||
private static final char[] TABLE = {
|
||||
'\u20ac',
|
||||
'\u067e',
|
||||
'\u201a',
|
||||
'\u0192',
|
||||
'\u201e',
|
||||
'\u2026',
|
||||
'\u2020',
|
||||
'\u2021',
|
||||
'\u02c6',
|
||||
'\u2030',
|
||||
'\u0679',
|
||||
'\u2039',
|
||||
'\u0152',
|
||||
'\u0686',
|
||||
'\u0698',
|
||||
'\u0688',
|
||||
'\u06af',
|
||||
'\u2018',
|
||||
'\u2019',
|
||||
'\u201c',
|
||||
'\u201d',
|
||||
'\u2022',
|
||||
'\u2013',
|
||||
'\u2014',
|
||||
'\u06a9',
|
||||
'\u2122',
|
||||
'\u0691',
|
||||
'\u203a',
|
||||
'\u0153',
|
||||
'\u200c',
|
||||
'\u200d',
|
||||
'\u06ba',
|
||||
'\u00a0',
|
||||
'\u060c',
|
||||
'\u00a2',
|
||||
'\u00a3',
|
||||
'\u00a4',
|
||||
'\u00a5',
|
||||
'\u00a6',
|
||||
'\u00a7',
|
||||
'\u00a8',
|
||||
'\u00a9',
|
||||
'\u06be',
|
||||
'\u00ab',
|
||||
'\u00ac',
|
||||
'\u00ad',
|
||||
'\u00ae',
|
||||
'\u00af',
|
||||
'\u00b0',
|
||||
'\u00b1',
|
||||
'\u00b2',
|
||||
'\u00b3',
|
||||
'\u00b4',
|
||||
'\u00b5',
|
||||
'\u00b6',
|
||||
'\u00b7',
|
||||
'\u00b8',
|
||||
'\u00b9',
|
||||
'\u061b',
|
||||
'\u00bb',
|
||||
'\u00bc',
|
||||
'\u00bd',
|
||||
'\u00be',
|
||||
'\u061f',
|
||||
'\u06c1',
|
||||
'\u0621',
|
||||
'\u0622',
|
||||
'\u0623',
|
||||
'\u0624',
|
||||
'\u0625',
|
||||
'\u0626',
|
||||
'\u0627',
|
||||
'\u0628',
|
||||
'\u0629',
|
||||
'\u062a',
|
||||
'\u062b',
|
||||
'\u062c',
|
||||
'\u062d',
|
||||
'\u062e',
|
||||
'\u062f',
|
||||
'\u0630',
|
||||
'\u0631',
|
||||
'\u0632',
|
||||
'\u0633',
|
||||
'\u0634',
|
||||
'\u0635',
|
||||
'\u0636',
|
||||
'\u00d7',
|
||||
'\u0637',
|
||||
'\u0638',
|
||||
'\u0639',
|
||||
'\u063a',
|
||||
'\u0640',
|
||||
'\u0641',
|
||||
'\u0642',
|
||||
'\u0643',
|
||||
'\u00e0',
|
||||
'\u0644',
|
||||
'\u00e2',
|
||||
'\u0645',
|
||||
'\u0646',
|
||||
'\u0647',
|
||||
'\u0648',
|
||||
'\u00e7',
|
||||
'\u00e8',
|
||||
'\u00e9',
|
||||
'\u00ea',
|
||||
'\u00eb',
|
||||
'\u0649',
|
||||
'\u064a',
|
||||
'\u00ee',
|
||||
'\u00ef',
|
||||
'\u064b',
|
||||
'\u064c',
|
||||
'\u064d',
|
||||
'\u064e',
|
||||
'\u00f4',
|
||||
'\u064f',
|
||||
'\u0650',
|
||||
'\u00f7',
|
||||
'\u0651',
|
||||
'\u00f9',
|
||||
'\u0652',
|
||||
'\u00fb',
|
||||
'\u00fc',
|
||||
'\u200e',
|
||||
'\u200f',
|
||||
'\u06d2'
|
||||
};
|
||||
|
||||
private static final String[] LABELS = {
|
||||
"cp1256",
|
||||
"windows-1256",
|
||||
"x-cp1256"
|
||||
};
|
||||
|
||||
private static final String NAME = "windows-1256";
|
||||
|
||||
static final Encoding INSTANCE = new Windows1256();
|
||||
|
||||
private Windows1256() {
|
||||
super(NAME, LABELS);
|
||||
}
|
||||
|
||||
@Override public CharsetDecoder newDecoder() {
|
||||
return new InfallibleSingleByteDecoder(this, TABLE);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,183 @@
|
||||
/*
|
||||
* Copyright (c) 2013-2015 Mozilla Foundation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* THIS IS A GENERATED FILE. PLEASE DO NOT EDIT.
|
||||
* Instead, please regenerate using generate-encoding-data.py
|
||||
*/
|
||||
|
||||
package nu.validator.encoding;
|
||||
|
||||
import java.nio.charset.CharsetDecoder;
|
||||
|
||||
class Windows1257 extends Encoding {
|
||||
|
||||
private static final char[] TABLE = {
|
||||
'\u20ac',
|
||||
'\u0081',
|
||||
'\u201a',
|
||||
'\u0083',
|
||||
'\u201e',
|
||||
'\u2026',
|
||||
'\u2020',
|
||||
'\u2021',
|
||||
'\u0088',
|
||||
'\u2030',
|
||||
'\u008a',
|
||||
'\u2039',
|
||||
'\u008c',
|
||||
'\u00a8',
|
||||
'\u02c7',
|
||||
'\u00b8',
|
||||
'\u0090',
|
||||
'\u2018',
|
||||
'\u2019',
|
||||
'\u201c',
|
||||
'\u201d',
|
||||
'\u2022',
|
||||
'\u2013',
|
||||
'\u2014',
|
||||
'\u0098',
|
||||
'\u2122',
|
||||
'\u009a',
|
||||
'\u203a',
|
||||
'\u009c',
|
||||
'\u00af',
|
||||
'\u02db',
|
||||
'\u009f',
|
||||
'\u00a0',
|
||||
'\ufffd',
|
||||
'\u00a2',
|
||||
'\u00a3',
|
||||
'\u00a4',
|
||||
'\ufffd',
|
||||
'\u00a6',
|
||||
'\u00a7',
|
||||
'\u00d8',
|
||||
'\u00a9',
|
||||
'\u0156',
|
||||
'\u00ab',
|
||||
'\u00ac',
|
||||
'\u00ad',
|
||||
'\u00ae',
|
||||
'\u00c6',
|
||||
'\u00b0',
|
||||
'\u00b1',
|
||||
'\u00b2',
|
||||
'\u00b3',
|
||||
'\u00b4',
|
||||
'\u00b5',
|
||||
'\u00b6',
|
||||
'\u00b7',
|
||||
'\u00f8',
|
||||
'\u00b9',
|
||||
'\u0157',
|
||||
'\u00bb',
|
||||
'\u00bc',
|
||||
'\u00bd',
|
||||
'\u00be',
|
||||
'\u00e6',
|
||||
'\u0104',
|
||||
'\u012e',
|
||||
'\u0100',
|
||||
'\u0106',
|
||||
'\u00c4',
|
||||
'\u00c5',
|
||||
'\u0118',
|
||||
'\u0112',
|
||||
'\u010c',
|
||||
'\u00c9',
|
||||
'\u0179',
|
||||
'\u0116',
|
||||
'\u0122',
|
||||
'\u0136',
|
||||
'\u012a',
|
||||
'\u013b',
|
||||
'\u0160',
|
||||
'\u0143',
|
||||
'\u0145',
|
||||
'\u00d3',
|
||||
'\u014c',
|
||||
'\u00d5',
|
||||
'\u00d6',
|
||||
'\u00d7',
|
||||
'\u0172',
|
||||
'\u0141',
|
||||
'\u015a',
|
||||
'\u016a',
|
||||
'\u00dc',
|
||||
'\u017b',
|
||||
'\u017d',
|
||||
'\u00df',
|
||||
'\u0105',
|
||||
'\u012f',
|
||||
'\u0101',
|
||||
'\u0107',
|
||||
'\u00e4',
|
||||
'\u00e5',
|
||||
'\u0119',
|
||||
'\u0113',
|
||||
'\u010d',
|
||||
'\u00e9',
|
||||
'\u017a',
|
||||
'\u0117',
|
||||
'\u0123',
|
||||
'\u0137',
|
||||
'\u012b',
|
||||
'\u013c',
|
||||
'\u0161',
|
||||
'\u0144',
|
||||
'\u0146',
|
||||
'\u00f3',
|
||||
'\u014d',
|
||||
'\u00f5',
|
||||
'\u00f6',
|
||||
'\u00f7',
|
||||
'\u0173',
|
||||
'\u0142',
|
||||
'\u015b',
|
||||
'\u016b',
|
||||
'\u00fc',
|
||||
'\u017c',
|
||||
'\u017e',
|
||||
'\u02d9'
|
||||
};
|
||||
|
||||
private static final String[] LABELS = {
|
||||
"cp1257",
|
||||
"windows-1257",
|
||||
"x-cp1257"
|
||||
};
|
||||
|
||||
private static final String NAME = "windows-1257";
|
||||
|
||||
static final Encoding INSTANCE = new Windows1257();
|
||||
|
||||
private Windows1257() {
|
||||
super(NAME, LABELS);
|
||||
}
|
||||
|
||||
@Override public CharsetDecoder newDecoder() {
|
||||
return new FallibleSingleByteDecoder(this, TABLE);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,183 @@
|
||||
/*
|
||||
* Copyright (c) 2013-2015 Mozilla Foundation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* THIS IS A GENERATED FILE. PLEASE DO NOT EDIT.
|
||||
* Instead, please regenerate using generate-encoding-data.py
|
||||
*/
|
||||
|
||||
package nu.validator.encoding;
|
||||
|
||||
import java.nio.charset.CharsetDecoder;
|
||||
|
||||
class Windows1258 extends Encoding {
|
||||
|
||||
private static final char[] TABLE = {
|
||||
'\u20ac',
|
||||
'\u0081',
|
||||
'\u201a',
|
||||
'\u0192',
|
||||
'\u201e',
|
||||
'\u2026',
|
||||
'\u2020',
|
||||
'\u2021',
|
||||
'\u02c6',
|
||||
'\u2030',
|
||||
'\u008a',
|
||||
'\u2039',
|
||||
'\u0152',
|
||||
'\u008d',
|
||||
'\u008e',
|
||||
'\u008f',
|
||||
'\u0090',
|
||||
'\u2018',
|
||||
'\u2019',
|
||||
'\u201c',
|
||||
'\u201d',
|
||||
'\u2022',
|
||||
'\u2013',
|
||||
'\u2014',
|
||||
'\u02dc',
|
||||
'\u2122',
|
||||
'\u009a',
|
||||
'\u203a',
|
||||
'\u0153',
|
||||
'\u009d',
|
||||
'\u009e',
|
||||
'\u0178',
|
||||
'\u00a0',
|
||||
'\u00a1',
|
||||
'\u00a2',
|
||||
'\u00a3',
|
||||
'\u00a4',
|
||||
'\u00a5',
|
||||
'\u00a6',
|
||||
'\u00a7',
|
||||
'\u00a8',
|
||||
'\u00a9',
|
||||
'\u00aa',
|
||||
'\u00ab',
|
||||
'\u00ac',
|
||||
'\u00ad',
|
||||
'\u00ae',
|
||||
'\u00af',
|
||||
'\u00b0',
|
||||
'\u00b1',
|
||||
'\u00b2',
|
||||
'\u00b3',
|
||||
'\u00b4',
|
||||
'\u00b5',
|
||||
'\u00b6',
|
||||
'\u00b7',
|
||||
'\u00b8',
|
||||
'\u00b9',
|
||||
'\u00ba',
|
||||
'\u00bb',
|
||||
'\u00bc',
|
||||
'\u00bd',
|
||||
'\u00be',
|
||||
'\u00bf',
|
||||
'\u00c0',
|
||||
'\u00c1',
|
||||
'\u00c2',
|
||||
'\u0102',
|
||||
'\u00c4',
|
||||
'\u00c5',
|
||||
'\u00c6',
|
||||
'\u00c7',
|
||||
'\u00c8',
|
||||
'\u00c9',
|
||||
'\u00ca',
|
||||
'\u00cb',
|
||||
'\u0300',
|
||||
'\u00cd',
|
||||
'\u00ce',
|
||||
'\u00cf',
|
||||
'\u0110',
|
||||
'\u00d1',
|
||||
'\u0309',
|
||||
'\u00d3',
|
||||
'\u00d4',
|
||||
'\u01a0',
|
||||
'\u00d6',
|
||||
'\u00d7',
|
||||
'\u00d8',
|
||||
'\u00d9',
|
||||
'\u00da',
|
||||
'\u00db',
|
||||
'\u00dc',
|
||||
'\u01af',
|
||||
'\u0303',
|
||||
'\u00df',
|
||||
'\u00e0',
|
||||
'\u00e1',
|
||||
'\u00e2',
|
||||
'\u0103',
|
||||
'\u00e4',
|
||||
'\u00e5',
|
||||
'\u00e6',
|
||||
'\u00e7',
|
||||
'\u00e8',
|
||||
'\u00e9',
|
||||
'\u00ea',
|
||||
'\u00eb',
|
||||
'\u0301',
|
||||
'\u00ed',
|
||||
'\u00ee',
|
||||
'\u00ef',
|
||||
'\u0111',
|
||||
'\u00f1',
|
||||
'\u0323',
|
||||
'\u00f3',
|
||||
'\u00f4',
|
||||
'\u01a1',
|
||||
'\u00f6',
|
||||
'\u00f7',
|
||||
'\u00f8',
|
||||
'\u00f9',
|
||||
'\u00fa',
|
||||
'\u00fb',
|
||||
'\u00fc',
|
||||
'\u01b0',
|
||||
'\u20ab',
|
||||
'\u00ff'
|
||||
};
|
||||
|
||||
private static final String[] LABELS = {
|
||||
"cp1258",
|
||||
"windows-1258",
|
||||
"x-cp1258"
|
||||
};
|
||||
|
||||
private static final String NAME = "windows-1258";
|
||||
|
||||
static final Encoding INSTANCE = new Windows1258();
|
||||
|
||||
private Windows1258() {
|
||||
super(NAME, LABELS);
|
||||
}
|
||||
|
||||
@Override public CharsetDecoder newDecoder() {
|
||||
return new InfallibleSingleByteDecoder(this, TABLE);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,186 @@
|
||||
/*
|
||||
* Copyright (c) 2013-2015 Mozilla Foundation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* THIS IS A GENERATED FILE. PLEASE DO NOT EDIT.
|
||||
* Instead, please regenerate using generate-encoding-data.py
|
||||
*/
|
||||
|
||||
package nu.validator.encoding;
|
||||
|
||||
import java.nio.charset.CharsetDecoder;
|
||||
|
||||
class Windows874 extends Encoding {
|
||||
|
||||
private static final char[] TABLE = {
|
||||
'\u20ac',
|
||||
'\u0081',
|
||||
'\u0082',
|
||||
'\u0083',
|
||||
'\u0084',
|
||||
'\u2026',
|
||||
'\u0086',
|
||||
'\u0087',
|
||||
'\u0088',
|
||||
'\u0089',
|
||||
'\u008a',
|
||||
'\u008b',
|
||||
'\u008c',
|
||||
'\u008d',
|
||||
'\u008e',
|
||||
'\u008f',
|
||||
'\u0090',
|
||||
'\u2018',
|
||||
'\u2019',
|
||||
'\u201c',
|
||||
'\u201d',
|
||||
'\u2022',
|
||||
'\u2013',
|
||||
'\u2014',
|
||||
'\u0098',
|
||||
'\u0099',
|
||||
'\u009a',
|
||||
'\u009b',
|
||||
'\u009c',
|
||||
'\u009d',
|
||||
'\u009e',
|
||||
'\u009f',
|
||||
'\u00a0',
|
||||
'\u0e01',
|
||||
'\u0e02',
|
||||
'\u0e03',
|
||||
'\u0e04',
|
||||
'\u0e05',
|
||||
'\u0e06',
|
||||
'\u0e07',
|
||||
'\u0e08',
|
||||
'\u0e09',
|
||||
'\u0e0a',
|
||||
'\u0e0b',
|
||||
'\u0e0c',
|
||||
'\u0e0d',
|
||||
'\u0e0e',
|
||||
'\u0e0f',
|
||||
'\u0e10',
|
||||
'\u0e11',
|
||||
'\u0e12',
|
||||
'\u0e13',
|
||||
'\u0e14',
|
||||
'\u0e15',
|
||||
'\u0e16',
|
||||
'\u0e17',
|
||||
'\u0e18',
|
||||
'\u0e19',
|
||||
'\u0e1a',
|
||||
'\u0e1b',
|
||||
'\u0e1c',
|
||||
'\u0e1d',
|
||||
'\u0e1e',
|
||||
'\u0e1f',
|
||||
'\u0e20',
|
||||
'\u0e21',
|
||||
'\u0e22',
|
||||
'\u0e23',
|
||||
'\u0e24',
|
||||
'\u0e25',
|
||||
'\u0e26',
|
||||
'\u0e27',
|
||||
'\u0e28',
|
||||
'\u0e29',
|
||||
'\u0e2a',
|
||||
'\u0e2b',
|
||||
'\u0e2c',
|
||||
'\u0e2d',
|
||||
'\u0e2e',
|
||||
'\u0e2f',
|
||||
'\u0e30',
|
||||
'\u0e31',
|
||||
'\u0e32',
|
||||
'\u0e33',
|
||||
'\u0e34',
|
||||
'\u0e35',
|
||||
'\u0e36',
|
||||
'\u0e37',
|
||||
'\u0e38',
|
||||
'\u0e39',
|
||||
'\u0e3a',
|
||||
'\ufffd',
|
||||
'\ufffd',
|
||||
'\ufffd',
|
||||
'\ufffd',
|
||||
'\u0e3f',
|
||||
'\u0e40',
|
||||
'\u0e41',
|
||||
'\u0e42',
|
||||
'\u0e43',
|
||||
'\u0e44',
|
||||
'\u0e45',
|
||||
'\u0e46',
|
||||
'\u0e47',
|
||||
'\u0e48',
|
||||
'\u0e49',
|
||||
'\u0e4a',
|
||||
'\u0e4b',
|
||||
'\u0e4c',
|
||||
'\u0e4d',
|
||||
'\u0e4e',
|
||||
'\u0e4f',
|
||||
'\u0e50',
|
||||
'\u0e51',
|
||||
'\u0e52',
|
||||
'\u0e53',
|
||||
'\u0e54',
|
||||
'\u0e55',
|
||||
'\u0e56',
|
||||
'\u0e57',
|
||||
'\u0e58',
|
||||
'\u0e59',
|
||||
'\u0e5a',
|
||||
'\u0e5b',
|
||||
'\ufffd',
|
||||
'\ufffd',
|
||||
'\ufffd',
|
||||
'\ufffd'
|
||||
};
|
||||
|
||||
private static final String[] LABELS = {
|
||||
"dos-874",
|
||||
"iso-8859-11",
|
||||
"iso8859-11",
|
||||
"iso885911",
|
||||
"tis-620",
|
||||
"windows-874"
|
||||
};
|
||||
|
||||
private static final String NAME = "windows-874";
|
||||
|
||||
static final Encoding INSTANCE = new Windows874();
|
||||
|
||||
private Windows874() {
|
||||
super(NAME, LABELS);
|
||||
}
|
||||
|
||||
@Override public CharsetDecoder newDecoder() {
|
||||
return new FallibleSingleByteDecoder(this, TABLE);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user