mirror of
https://github.com/binwiederhier/ntfy.git
synced 2026-05-09 08:26:00 +02:00
[GH-ISSUE #608] Accent issue! #459
Labels
No labels
ai-generated
android-app
android-app
android-app
🪲 bug
build
build
dependencies
docs
enhancement
enhancement
🔥 HOT
in-progress 🏃
ios
prio:low
prio:low
pull-request
question
🔒 security
server
server
unified-push
web-app
website
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/ntfy#459
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @entonoire on GitHub (Feb 14, 2023).
Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/608
When you send a notification with accent it's adding an .txt attachement or in some cases not even send. I tried to encode it in url format but it keeped as url format, so maybe a converter to normal text on the api could be nice.
@binwiederhier commented on GitHub (Feb 14, 2023):
ntfy converts messages to attachments when you send text that is not valid UTF-8. So this is an issue with whatever client you are using to send the message.
If you share the code, we may be able to help.
@entonoire commented on GitHub (Feb 14, 2023):
this is my code (kotlin)
after some test, this only happens in title
val request = Request.Builder()
.url("https://ntfy.sh/?")
.post(message.toRequestBody("text/html; charset=UTF-8".toMediaType()))
.addHeader("Title", title)
.addHeader("Priority", parsePriority(priority))
request.addHeader("Tags", tag])
OkHttpClient().newCall(request.build()).execute()
@t4nki commented on GitHub (Feb 14, 2023):
Hi!
I encountered exactly the same issue last week with Ansible and Header définitiion in uri module.
To circumvrent this, i generated a json payload directly with ansible.
After that, the title appeared normally with any special character (é, è, à, ç etc...)
eg:
uri:
url: https://ntfy.local
method: POST
body_format: json
body:
topic: myTopic
message: "{{ message }}"
title: "mise à jour"
priority: 4
.
..
...
This did the trick
@binwiederhier commented on GitHub (Feb 14, 2023):
Offically, afaik, the HTTP spec does not allow UTF-8 headers, so it is quite normal for some clients or libraries to not support it. ntfy (and the ntfy server) definitely support sending UTF-8 headers. You can test it with curl, like so:
That said, if your client does not support it, you can always send it in the JSON body, like @t4nki suggested, or you can send it as a query parameter:
@entonoire commented on GitHub (Feb 14, 2023):
oh thanks ! i will try the query parameter!