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:
hns 2001-09-14 12:27:33 +00:00
parent e04f7652ba
commit e1cf1c1f8a

View file

@ -18,6 +18,7 @@ import java.text.*;
public final class HtmlEncoder {
/*
static final Hashtable convertor = new Hashtable (128);
// conversion table
@ -118,7 +119,7 @@ public final class HtmlEncoder {
convertor.put(new Integer(253), "ý");
convertor.put(new Integer(254), "þ");
convertor.put(new Integer(255), "ÿ");
}
} */
/**
*
@ -198,8 +199,8 @@ public final class HtmlEncoder {
default:
if (c < 160)
ret.append ((char) c);
else if (c >= 160 && c <= 255)
ret.append (convertor.get(new Integer(c)));
// else if (c >= 160 && c <= 255)
// ret.append (convertor.get(new Integer(c)));
else {
ret.append ("&#");
ret.append (c);
@ -274,8 +275,8 @@ public final class HtmlEncoder {
default:
if (c < 160)
ret.append ((char) c);
else if (c >= 160 && c <= 255)
ret.append (convertor.get(new Integer(c)));
// else if (c >= 160 && c <= 255)
// ret.append (convertor.get(new Integer(c)));
else {
ret.append ("&#");
ret.append (c);
@ -308,8 +309,8 @@ public final class HtmlEncoder {
default:
if (c < 160)
ret.append ((char) c);
else if (c >= 160 && c <= 255)
ret.append (convertor.get(new Integer(c)));
// else if (c >= 160 && c <= 255)
// ret.append (convertor.get(new Integer(c)));
else {
ret.append ("&#");
ret.append (c);