try
{
parser = new Parser("http://www.sony.co.jp", Parser.DEVNULL);
assertEquals("Character set by default is ISO-8859-1", "ISO-8859-1", parser.getEncoding ());
enumeration = parser.elements();
// search for the <BODY> tag
while (enumeration.hasMoreNodes ())
if (enumeration.nextNode () instanceof BodyTag)
break;
assertTrue("Character set should be Shift_JIS", parser.getEncoding ().equalsIgnoreCase ("Shift_JIS"));