Menu

#20 meta charset can cause UnsupportedOperationException

Unstable (example)
closed-fixed
None
5
2015-04-16
2014-06-10
Steve McKay
No

When a meta charset is able to decode but not encode, HTMLScanner.isEncodingCompatible() will throw UnsupportedOperationException in String.getBytes(). Attached patch allows for this case, test case included.

1 Attachments

Discussion

  • Steve McKay

    Steve McKay - 2014-06-11

    In the patch, I returned false after 2 UnsupportedOperationExceptions. Upon reflection I don't think that's the desirable. Both encodings are valid, or there would have been an UnsupportedEncodingException. Unless there's something further that could be done to check whether the new encoding will work, I think the right thing is to trust the document about its content. ignore-specified-charset is already available if the client isn't willing to trust the document.

     
  • Marc Guillemot

    Marc Guillemot - 2015-04-16
    • status: open --> closed-fixed
    • assigned_to: Marc Guillemot
     
  • Marc Guillemot

    Marc Guillemot - 2015-04-16

    Patch applied. Many thanks and sorry for the delay.

     

Log in to post a comment.

MongoDB Logo MongoDB