Uploaded image for project: 'Qpid Proton'
  1. Qpid Proton
  2. PROTON-576

proton-j: codec support for UTF-8 encoding and decoding appears broken?

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • proton-0.7
    • proton-0.8
    • proton-j
    • None

    Description

      It seems like Proton-J has its own custom UTF-8 encoder, but relies on Java String's built-in UTF-8 decoder. However, the code doesn't seem quite right and complex double byte UTF-8 like emoji ('📔🚢🍛🍴🍹🏊🏄') can quite easily fail to parse:

        Cause:1 :- java.lang.IllegalArgumentException: Cannot parse String
        Message:1 :- Cannot parse String
        StackTrace:1 :- java.lang.IllegalArgumentException: Cannot parse String
        at org.apache.qpid.proton.codec.StringType$1.decode(StringType.java:48)
        at org.apache.qpid.proton.codec.StringType$1.decode(StringType.java:36)
        at org.apache.qpid.proton.codec.DecoderImpl.readRaw(DecoderImpl.java:945)
        at org.apache.qpid.proton.codec.StringType$AllStringEncoding.readValue(StringType.java:172)
        at org.apache.qpid.proton.codec.StringType$AllStringEncoding.readValue(StringType.java:124)
        at org.apache.qpid.proton.codec.DynamicTypeConstructor.readValue(DynamicTypeConstructor.java:39)
        at org.apache.qpid.proton.codec.DecoderImpl.readObject(DecoderImpl.java:885)
        at org.apache.qpid.proton.message.impl.MessageImpl.decode(MessageImpl.java:629)

      Attachments

        1. PROTON-576.patch
          10 kB
          Robert Godfrey
        2. 02_fix_stringtype_encode_decode.patch
          10 kB
          Dominic Evans

        Issue Links

          Activity

            People

              Unassigned Unassigned
              dnwe Dominic Evans
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: