From c04af81779816118b2fb85e3ed44eba41ef5be24 Mon Sep 17 00:00:00 2001 From: David Szotten Date: Thu, 11 Apr 2019 16:02:19 +0100 Subject: handle non-ascii headers --- Modules/_librabbitmq/connection.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Modules/_librabbitmq/connection.c') diff --git a/Modules/_librabbitmq/connection.c b/Modules/_librabbitmq/connection.c index ee9b122..3ace2e3 100644 --- a/Modules/_librabbitmq/connection.c +++ b/Modules/_librabbitmq/connection.c @@ -320,7 +320,7 @@ PyDict_ToAMQTable(amqp_connection_state_t conn, PyObject *src, amqp_pool_t *pool is_unicode = PyUnicode_Check(dvalue); if (is_unicode || PyBytes_Check(dvalue)) { if (is_unicode) { - if ((dvalue = PyUnicode_AsASCIIString(dvalue)) == NULL) + if ((dvalue = PyUnicode_AsEncodedString(dvalue, "utf-8", "strict")) == NULL) goto error; } AMQTable_SetStringValue(&dst, -- cgit v1.2.1