gmr/pamqp

Headers with byte values gets sent as strings which causes double encoding errors when other clients tries to decode it.

Closed this issue · 3 comments

For example if you read a pdf into bytes, send it as a header value, and then reads the data from the java RabbitMQ client then all non-ASCII characters are gone.

I worked around it by wrapping the bytes in a bytearray and applying the fix in #2

gmr commented

Thanks for your rigorous testing of this stuff and sorry you're having so many issues. I'll be looking into these today/tomorrow.

Don't worry :)

I have a few things I always test when I start using a new library. Dealing with strings and raw bytes is something most libraries have trouble with.

Heck, I just noticed PyCharm debugging on windows crashes if my python script have a variable with a non-ascii character in its name. print('ö'.encode().decode()) results in ö if I am debugging and ö if I am not.

gmr commented

Ok, I believe I've addressed this with the last changeset I pushed. Turns out that in the AMQP spec short strings are supposed to be UTF-8 encoded, but long strings are not. I've removed the forcing of UTF-8 on long-strings in the latest change set which should address your issue.