Uploaded image for project: 'Qpid'
  1. Qpid
  2. QPID-7109

Python wrapper for qpid-cpp cannot handle unicode data.

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: qpid-cpp-0.34
    • Fix Version/s: None
    • Labels:
      None
    • Environment:

      Red Hat Enterprise Linux Server release 6.7 (Santiago)

      Description

      The Python wrapper for the qpid-cpp library cannot handle unicode data properly. The reason for this is how unicode objects are encoded in the PyToVariant function, which is located in the "swig_python_typemaps.i" file.

      PyToVariant uses the PyUnicode_AS_DATA to encode the data, but that is wrong. It returns the internal representation of the data, which usually is UTF-16, but that depends on how the Python libraries where built. The VariantToPy function correctly uses the PyUnicode_DecodeUTF8 function, but that is not compatible with the data returned from PyUnicode_AS_DATA.

      The proper solution is to either use PyUnicode_EncodeUTF8 or PyUnicode_AsUTF8String, including proper error handling.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              hakanj HÃ¥kan Johansson
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: