<changes>
<release version="3.9-beta1" date="2012-??-??">
+ <action dev="poi-developers" type="fix">52211 - avoid unnessary re-coverting content types to US-ASCII, it can cause exceptions on ibm mainframes</action>
<action dev="poi-developers" type="fix">53568 - Set shapes anchors in XSSF when reading from existing drawings</action>
<action dev="poi-developers" type="add">HSSFOptimiser will now also tidy away un-used cell styles, in addition to duplicate styles</action>
<action dev="poi-developers" type="fix">53493 - Fixed memory and temporary file leak in SXSSF </action>
* If the specified content type is not valid with RFC 2616.
*/
public ContentType(String contentType) throws InvalidFormatException {
- // Conversion en US-ASCII
- String contentTypeASCII = null;
- try {
- contentTypeASCII = new String(contentType.getBytes(), "US-ASCII");
- } catch (UnsupportedEncodingException e) {
- throw new InvalidFormatException(
- "The specified content type is not an ASCII value.");
- }
-
- Matcher mMediaType = patternMediaType.matcher(contentTypeASCII);
+ Matcher mMediaType = patternMediaType.matcher(contentType);
if (!mMediaType.matches())
throw new InvalidFormatException(
"The specified content type '"
*/
public void testContentTypeParameterFailure() {
String[] contentTypesToTest = new String[] { "mail/toto;titi=tata",
- "text/xml;a=b;c=d", "mail/toto;\"titi=tata\"" };
+ "text/xml;a=b;c=d", "mail/toto;\"titi=tata\"",
+ "text/\u0080" // characters above ASCII are not allowed
+ };
for (int i = 0; i < contentTypesToTest.length; ++i) {
try {
new ContentType(contentTypesToTest[i]);