[GH-ISSUE #137] 带中文的 URL 推送,点击不能跳转 #126

Closed
opened 2026-03-03 11:37:19 +03:00 by kerem · 1 comment
Owner

Originally created by @ryanlid on GitHub (Feb 16, 2022).
Original GitHub issue: https://github.com/Finb/Bark/issues/137

例如:

curl 'https://api.day.app/{KEY}/' \
  -H 'content-type: application/json' \
  -d '{"title":"创建笔记","body":"内容","group":"test","url":"https://www.baidu.com/s?wd=中文"}'

推送后,点击推送消息,不能跳转打开 URL地址

图片

Originally created by @ryanlid on GitHub (Feb 16, 2022). Original GitHub issue: https://github.com/Finb/Bark/issues/137 例如: ``` curl 'https://api.day.app/{KEY}/' \ -H 'content-type: application/json' \ -d '{"title":"创建笔记","body":"内容","group":"test","url":"https://www.baidu.com/s?wd=中文"}' ``` 推送后,点击推送消息,不能跳转打开 URL地址 ![图片](https://user-images.githubusercontent.com/6867964/154196996-41d87312-5ac8-4a75-ab74-aded4ae847be.jpg)
kerem closed this issue 2026-03-03 11:37:19 +03:00
Author
Owner

@Finb commented on GitHub (Feb 16, 2022):

URL规范中不允许出现中文, 常见的浏览器上显示出中文都是浏览器做了一个转换,实际复制下来的真实URL是如下面这样的。
https://www.baidu.com/s?wd=%E4%B8%AD%E6%96%87 ,传递也应该传这样的

简单点处理,就是URL中的参数部分如果出现特殊字符,则加一层URL编码(最好无脑加一层)
https://www.baidu.com/s?wd={url编码后的参数值}

<!-- gh-comment-id:1041113510 --> @Finb commented on GitHub (Feb 16, 2022): URL规范中不允许出现中文, 常见的浏览器上显示出中文都是浏览器做了一个转换,实际复制下来的真实URL是如下面这样的。 https://www.baidu.com/s?wd=%E4%B8%AD%E6%96%87 ,传递也应该传这样的 简单点处理,就是URL中的参数部分如果出现特殊字符,则加一层URL编码(最好无脑加一层) https://www.baidu.com/s?wd={url编码后的参数值}
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/Bark#126
No description provided.