Having some issues which might be related to strin...
# kotlin-native
n
Having some issues which might be related to string encoding ( https://kotlinlang.slack.com/archives/C3SGXARS6/p1593155207088900 ) although i'm not entirely sure. What are the key things to check when dealing with a C library handling strings?
Turns out that the amqp_cstring_bytes function is expecting a C string. I have fixed the issue by adding a line to the def file to disable string conversion:
Copy code
noStringConversion = amqp_cstring_bytes
After doing that I modified the amqp_basic_publish call to the following:
Copy code
amqp_basic_publish(
        state = conn,
        channel = channel,
        exchange = amqp_cstring_bytes(EXCHANGE.cstr.ptr),
        routing_key = amqp_cstring_bytes(ROUTING_KEY.cstr.ptr),
        mandatory = true.intValue,
        immediate = false.intValue,
        properties = props.ptr,
        body = amqp_cstring_bytes(MSG_BODY.cstr.ptr)
    )