Publish unicode string using solclientjs
I am trying to publish a non-ascii string to a solace topic using the solclientjs library in nodeJs, and consume the same using the golang solace messaging library, and vice-versa (i.e. golang to nodeJs).
Example string: abc-nonascii_ãçï_স
I understand I have three options to do this in solclientjs: as BinaryAttachment, as XMLContent, or as SDT Field.
However, the first option of BinaryAttachment seems to support only latin1 encoding, and the non-ascii characters are not sent correctly. The third option of SDT Field of ByteArray type also seems to have the same issue. The second option of XMLContent seems to be the only option, however I read that it is a legacy type and the golang library also does not have it as an explicit option.
I have tried changing the SolClientFactory Profile to version10_5, which makes the consumer correctly decode the unicode bytes, but the publisher still fails to encode the string correctly. I also see the same mentioned in the docs.
Hence I have two questions:
- What is the recommended way to transfer unicode strings in solace client libraries?
- Is it expected/desirable for the publisher to behave differently from the consumer when using the same factory profile version?