Hello,
I’m trying to update some item with status that may contain specials char like “è” in one of my item, but I keep getting � in my states
The request I’m testing is
curl --request POST \
--url https://home.myopenhab.org/rest/items/Integromat_Notify \
--header 'authorization: Basic hey, dont look at this!!' \
--header 'content-type: text/plain; charset=utf-8' \
--cookie X-OPENHAB-AUTH-HEADER=true \
--data 'è_é'
I’ve tested other content-type with not better result.
Edit : The local API does not do the same thing, I though due to the console logging char error, but the data is fine in DB
Hello,
For your information, I was able to fix this issue by… simply avoiding it
I now base64 encode my payload then unencode them after. It’s even better as this way, even the console logs are fine for some reason!!
I cant tell you how to base64 encode the body first as it depend from when it came, but to decode it I did a simple val event = new String(java.util.Base64.decoder.decode(newState.toString().getBytes("UTF-8")), "UTF-8");
If you know a better way, I would like to know it, but this one seem fine
Edit: I had to had the “UTF-8” while decoding to avoid other encoding issue