Results 1 to 4 of 4
  1. #1
    sixsigma1978 is offline Member
    Join Date
    May 2011
    Posts
    4
    Rep Power
    0

    Default CharacterCodingException vs UnsupportedEncodingException

    I'm trying to decode a file using UTF-8 - which I assumed is the "parent" encoding set.
    However, I get the CharactercodingException - My assumption was that UnsupportedEncodingException would be thrown!!

    Anyone can tell me the difference between the two?
    CharactercodingException vs UnsupportedEncodingExceptionCharactercodingException vs UnsupportedEncodingException

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,305
    Rep Power
    25

    Default

    Have you read the API documentation?

    Is there any more information in the error message?

  3. #3
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,336
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by sixsigma1978 View Post
    I'm trying to decode a file using UTF-8 - which I assumed is the "parent" encoding set.
    However, I get the CharactercodingException - My assumption was that UnsupportedEncodingException would be thrown!!

    Anyone can tell me the difference between the two?
    CharactercodingException vs UnsupportedEncodingExceptionCharactercodingException vs UnsupportedEncodingException
    You get an UEE if you specify a non-existing encoding, say "UTF-42". You get a CCE if an unknown byte value is present in the input stream (not all byte values at every position make sense as a UTF-8 encoded stream).

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  4. #4
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,305
    Rep Power
    25

    Default

    What is the hex value of the input data that causes the exception?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •