Bug 38765 - UMCP does not handle Unicode very well
UMCP does not handle Unicode very well
Status: RESOLVED DUPLICATE of bug 41084
Product: UCS
Classification: Unclassified
Component: UMC (Generic)
UCS 4.0
Other Linux
: P5 normal (vote)
: UCS 4.0-x
Assigned To: UMC maintainers
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2015-06-25 11:29 CEST by Dirk Wiesenthal
Modified: 2016-04-22 20:33 CEST (History)
2 users (show)

See Also:
What kind of report is it?: ---
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:
best: Patch_Available+


Attachments
patch (751 bytes, patch)
2015-06-25 11:37 CEST, Florian Best
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dirk Wiesenthal univentionstaff 2015-06-25 11:29:38 CEST
The following command fails:

  def get(self, request):
    self.finished(request.id, u"öä", mimetype="text/html")

Maybe we can encode('utf-8') the result when necessary?

Does not happen very often as we normally return mimetype="application/json". In fact, I do not know of any place in our code where this could happen.

But external developers may stumble upon it.
Comment 1 Florian Best univentionstaff 2015-06-25 11:37:08 CEST
Created attachment 6981 [details]
patch

The problem here is that UMCP expects bytes to calculate the length of the payload. The API is not designed to give unicode objects.

message_length = len(body)

Attached patch would also allow a unicode body. (if we want to support this).
Comment 2 Florian Best univentionstaff 2016-04-22 20:33:20 CEST

*** This bug has been marked as a duplicate of bug 41084 ***