f = (ContentTypeField) Field.parse("Content-Type: some/type;");
assertEquals("us-ascii", ContentTypeField.getCharset(f));
}
public void testGetParameter() {
ContentTypeField f = null;
f = (ContentTypeField) Field.parse("CONTENT-TYPE: text / html ;"
+ " boundary=yada yada");
assertEquals("yada", f.getParameter("boundary"));
f = (ContentTypeField) Field.parse("Content-Type: x-app/yada;"
+ " boUNdarY= \"ya:\\\"*da\"; "
+ "\tcharset\t = us-ascii");
assertEquals("ya:\"*da", f.getParameter("boundary"));
assertEquals("us-ascii", f.getParameter("charset"));
f = (ContentTypeField) Field.parse("Content-Type: x-app/yada; "
+ "boUNdarY= \"ya \\\"\\\"\tda \\\"\"; "
+ "\tcharset\t = \"\\\"hepp\\\" =us\t-ascii\"");
assertEquals("ya \"\"\tda \"", f.getParameter("boundary"));
assertEquals("\"hepp\" =us\t-ascii", f.getParameter("charset"));
}