double escape? not sure, usually you need to escape once and then there goes your chars. But frankly I dunno, sending escaping chars to MQTT which is purely string based sounds to me bit weird.
that example is for cmndline mosquito_pub, have you tried to send it as whole text without escape chars?
not sure what is equivalent of Json object in OH, but when working with ESP’s this kind of code makes json publish into the mqtt
StaticJsonBuffer<300> jsonBuffer;
JsonObject& root = jsonBuffer.createObject();
root["ver"] = swVersion;
root["Uptime"] = String(uptime::getDays()) + "T" + String(uptime::getHours()) + ":" + String(uptime::getMinutes()) + ":" + String(uptime::getSeconds());
root["Temperature"] = decimals(iaqSensor.temperature,1);
root["Humidity"] = decimals(iaqSensor.rawHumidity,1);
root["Pressure"] = decimals((iaqSensor.pressure / 1e2),1);
root["Gas"] = decimals((iaqSensor.gasResistance / 1e3),2);
root["IAQ"] = decimals(iaqSensor.iaqEstimate,1);
root["sIAQ"] = decimals(iaqSensor.staticIaq,1);
root["IAQ_Accuracy"] = iaqSensor.iaqAccuracy;
root["CO2e"] = decimals(iaqSensor.co2Equivalent,3);
root["bVOC"] = decimals(iaqSensor.breathVocEquivalent,3);
root["rawTemperature"] = decimals(iaqSensor.rawTemperature,1);
root["rawHumidity"] = decimals(iaqSensor.humidity,1);
// use it as JSON
char data[300];
root.printTo(data, root.measureLength() + 1);
// mqtt report
client.publish(mqtt_topic, data);
which then produce
home/climate/livingroom {"ver":"0.6","Uptime":"3T11:52:2","Temperature":21.2,"Humidity":45.9,"Pressure":973.4,"Gas":404.47,"IAQ":248.4,"sIAQ":155.5,"IAQ_Accuracy":2,"CO2e":1555.14,"bVOC":3.596,"rawTemperature":21.3,"rawHumidity":46.2}
As you can see, there are no escape characters at all