Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mosquitto_sub -F "%j" not encoding correctly #1220

Closed
benbarbour opened this issue Apr 1, 2019 · 1 comment

Comments

Projects
None yet
2 participants
@benbarbour
Copy link

commented Apr 1, 2019

Steps to Reproduce

  1. echo -n '"DATA"' | mosquitto_pub -s -r -t myTopic
  2. mosquitto_sub -t "myTopic/#" -F "%j" -W 1

Expected Output:

{
 "tst": 1554139867,
  "topic": "myTopic",
  "qos": 0,
  "retain": 1,
  "payloadlen": 6,
  "payload": "\"DATA\""
}

Actual Output:

{
 "tst": 1554139867,
  "topic": "myTopic",
  "qos": 0,
  "retain": 1,
  "payloadlen": 6,
  "payload": "\u0034DATA\u0034"
}

When I decode the actual output's payload using jq I get an error. When I try to unescape it (using a few different tools) I get "4DATA4".

ralight added a commit that referenced this issue Apr 11, 2019

@ralight

This comment has been minimized.

Copy link
Contributor

commented Apr 11, 2019

Thanks very much, this was a silly mistake. It will be in 1.6 shortly.

@ralight ralight closed this Apr 11, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.