[GH-ISSUE #608] Accent issue! #459

Closed
opened 2026-05-07 00:24:23 +02:00 by BreizhHardware · 5 comments

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.

image

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. ![image](https://cdn.discordapp.com/attachments/603938120509030401/1075025785963954177/Screenshot_20230214-130825.jpg)
BreizhHardware 2026-05-07 00:24:23 +02:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@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.

<!-- gh-comment-id:1429680420 --> @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.
Author
Owner

@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()

<!-- gh-comment-id:1429689411 --> @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()
Author
Owner

@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

<!-- gh-comment-id:1429929129 --> @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
Author
Owner

@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:

curl -H"Title: mise à jour 😊" -d "Hi" ntfy.sh/mytopic 
{"id":"DkV46Lwt6VbZ","time":1676389814,"event":"message","topic":"mytopic","title":"mise à jour 😊","message":"Hi"}

image

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:

curl -d "Hi" "ntfy.sh/mytopic?title=mise%20%C3%A0%20jour%20%F0%9F%98%8A"
{"id":"FIOnCAxlOEKZ","time":1676390000,"event":"message","topic":"mytopic","title":"mise à jour 😊","message":"Hi"}
<!-- gh-comment-id:1429973162 --> @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: ``` curl -H"Title: mise à jour 😊" -d "Hi" ntfy.sh/mytopic {"id":"DkV46Lwt6VbZ","time":1676389814,"event":"message","topic":"mytopic","title":"mise à jour 😊","message":"Hi"} ``` ![image](https://user-images.githubusercontent.com/664597/218788717-7e19a6d0-981e-49d1-ae4c-35b1ee12f117.png) That said, if your client does not support it, you can always [send it in the JSON body](https://docs.ntfy.sh/publish/#publish-as-json), like @t4nki suggested, or you can send it as a query parameter: ``` curl -d "Hi" "ntfy.sh/mytopic?title=mise%20%C3%A0%20jour%20%F0%9F%98%8A" {"id":"FIOnCAxlOEKZ","time":1676390000,"event":"message","topic":"mytopic","title":"mise à jour 😊","message":"Hi"} ```
Author
Owner

@entonoire commented on GitHub (Feb 14, 2023):

oh thanks ! i will try the query parameter!

<!-- gh-comment-id:1430418517 --> @entonoire commented on GitHub (Feb 14, 2023): oh thanks ! i will try the query parameter!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ntfy#459
No description provided.