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
Closed

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

benbarbour opened this issue Apr 1, 2019 · 1 comment

Comments

@benbarbour
Copy link

benbarbour 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
Copy link
Contributor

ralight commented Apr 11, 2019

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

@ralight ralight closed this as completed Apr 11, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Aug 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants