caronc / apprise-api

A lightweight REST framework that wraps the Apprise Notification Library
https://hub.docker.com/r/caronc/apprise
MIT License
580 stars 50 forks source link

Non-latin symbols processing #122

Closed squromiv closed 8 months ago

squromiv commented 1 year ago

:beetle: Describe the bug When I try to send a notification with non-latin symbols, it results to non-readable characters in received messages. Checked with Telegram and Gotify services.

:bulb: Screenshots and Logs Test commands curl.exe -X POST -d "title=Title&body=Body - ԱՅՈՑ ԱՅԲՈՒԲԵՆ" http://server/notify/telegram Result image

curl.exe -X POST -d "title=Title&body=Body - аулцшльфз зщтцгч" http://server/notify/gotify Result image

:computer: Your System Details:

caronc commented 1 year ago

I'm not able to reproduce this, but i'm wondering if it's a Windows problem as i notice you're using curl.exe.

I'm using Fedora 38 myself,, and i checked out the apprise-api and then:

# in one window
docker-compose up

# i went to http://localhost:8000 and set up the telegram url

# Then in another terminal window:
curl -X POST -d "title=Title&body=Body - ԱՅՈՑ ԱՅԲՈՒԲԵՆ" http://localhost:8000/notify/apprise/?tag=all
# 2023-07-06 20:07:19,742 [INFO] apprise: Loaded 1 entries from memory://
# 2023-07-06 20:07:20,461 [INFO] apprise: Sent Telegram notification.

...and it worked perfectly: image

I also tried just sending it through the website as another means of testing it out: image

... and it worked fine again.

Can you give me more details on your windows environment? What is the language set up for it? I think the curl.exe is mangling your data/payload and Apprise is just passing it along (garbage in, garbage out).

caronc commented 11 months ago

Can you provide me with more details on your curl call? I think you can add -v and get a more verbose output so we can see what the POST actually looks like.

I'm hoping that your server passes along the text encoding in the payload (as it doesn't appear to be utf-8 in your case.

caronc commented 11 months ago

Any further update to this?

squromiv commented 11 months ago

I am sorry. Was on vacation and had no access to internet. Will check in the nearest time. Thanks a lot for support.

squromiv commented 10 months ago

I'm not able to reproduce this, but i'm wondering if it's a Windows problem as i notice you're using curl.exe. I was wrong not to mention in the first message, that I had tried curl from Windows.

So today I have started curl from Ubuntu instance, where Aprise is located, and the result is good. All symbols are readable. It looks like something is wrong with Windows version of CURL app. Let`s close the issue.

squromiv commented 8 months ago

I have to go back to this problem, because still have no solution. I`ve found out, that command construction like this, using Unicode escape sequence representation, leads to the proper result for symbols mentioned above.

curl -k -X POST -d "{\"body\":\"Body - \u0531\u0545\u0578\u0581 \u0531\u0545\u0562\u0578\u0582\u0582\u0565\u0576\", \"title\":\"Title\"}" -H "Content-Type: application/json; charset=UTF-8" https://server/notify/tg

2_in

2_out

But how to apply such a command, without manually typing escape sequence representation for every symbol? Or what should I exactly ask the Curl`s developers?

caronc commented 8 months ago

What language is your OS in? I'm wondering if this falls when the default encoding isn't utf-8

squromiv commented 8 months ago

English.

squromiv commented 8 months ago

Finally, developers of curl confirmed, that the program has limited/incomplete Unicode support on Windows. So I will try to find another way to send commands to apprise-api from Windows instance. Thanks for quick support.