only use numerical entities to encode
characters codes greater than 160. The hope is that this gets us cheap support for international encodings...
This commit is contained in:
parent
e04f7652ba
commit
e1cf1c1f8a
1 changed files with 8 additions and 7 deletions
|
@ -18,6 +18,7 @@ import java.text.*;
|
||||||
public final class HtmlEncoder {
|
public final class HtmlEncoder {
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
static final Hashtable convertor = new Hashtable (128);
|
static final Hashtable convertor = new Hashtable (128);
|
||||||
|
|
||||||
// conversion table
|
// conversion table
|
||||||
|
@ -118,7 +119,7 @@ public final class HtmlEncoder {
|
||||||
convertor.put(new Integer(253), "ý");
|
convertor.put(new Integer(253), "ý");
|
||||||
convertor.put(new Integer(254), "þ");
|
convertor.put(new Integer(254), "þ");
|
||||||
convertor.put(new Integer(255), "ÿ");
|
convertor.put(new Integer(255), "ÿ");
|
||||||
}
|
} */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
@ -198,8 +199,8 @@ public final class HtmlEncoder {
|
||||||
default:
|
default:
|
||||||
if (c < 160)
|
if (c < 160)
|
||||||
ret.append ((char) c);
|
ret.append ((char) c);
|
||||||
else if (c >= 160 && c <= 255)
|
// else if (c >= 160 && c <= 255)
|
||||||
ret.append (convertor.get(new Integer(c)));
|
// ret.append (convertor.get(new Integer(c)));
|
||||||
else {
|
else {
|
||||||
ret.append ("&#");
|
ret.append ("&#");
|
||||||
ret.append (c);
|
ret.append (c);
|
||||||
|
@ -274,8 +275,8 @@ public final class HtmlEncoder {
|
||||||
default:
|
default:
|
||||||
if (c < 160)
|
if (c < 160)
|
||||||
ret.append ((char) c);
|
ret.append ((char) c);
|
||||||
else if (c >= 160 && c <= 255)
|
// else if (c >= 160 && c <= 255)
|
||||||
ret.append (convertor.get(new Integer(c)));
|
// ret.append (convertor.get(new Integer(c)));
|
||||||
else {
|
else {
|
||||||
ret.append ("&#");
|
ret.append ("&#");
|
||||||
ret.append (c);
|
ret.append (c);
|
||||||
|
@ -308,8 +309,8 @@ public final class HtmlEncoder {
|
||||||
default:
|
default:
|
||||||
if (c < 160)
|
if (c < 160)
|
||||||
ret.append ((char) c);
|
ret.append ((char) c);
|
||||||
else if (c >= 160 && c <= 255)
|
// else if (c >= 160 && c <= 255)
|
||||||
ret.append (convertor.get(new Integer(c)));
|
// ret.append (convertor.get(new Integer(c)));
|
||||||
else {
|
else {
|
||||||
ret.append ("&#");
|
ret.append ("&#");
|
||||||
ret.append (c);
|
ret.append (c);
|
||||||
|
|
Loading…
Add table
Reference in a new issue