[GH-ISSUE #199] 关于url跳转带中文参数时效 #181

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

Originally created by @wxjer on GitHub (May 31, 2023).
Original GitHub issue: https://github.com/Finb/Bark/issues/199

你好,
例子:https://bark.xxx.xx/key/title/content?url=taobao://s.taobao.com?q=abcd
如果q的值是英文,则能成功打开,如果是中文则无反应,整个url的参数都用了url编码(utf-8)

taobao%3A%2F%2Fs.taobao.com%3Fq%3Dabcd
taobao%3A%2F%2Fs.taobao.com%3Fq%3D%E8%9A%8A%E9%A6%99

麻烦有时间帮忙看一下

Originally created by @wxjer on GitHub (May 31, 2023). Original GitHub issue: https://github.com/Finb/Bark/issues/199 你好, 例子:https://bark.xxx.xx/key/title/content?url=taobao://s.taobao.com?q=abcd 如果q的值是英文,则能成功打开,如果是中文则无反应,整个url的参数都用了url编码(utf-8) taobao%3A%2F%2Fs.taobao.com%3Fq%3Dabcd taobao%3A%2F%2Fs.taobao.com%3Fq%3D%E8%9A%8A%E9%A6%99 麻烦有时间帮忙看一下
kerem closed this issue 2026-03-03 11:37:47 +03:00
Author
Owner

@Finb commented on GitHub (Jul 25, 2023):

首先要规范taobao 的URL,下面是对的

taobao://s.taobao.com?q=abcd

下面的是错误的,有中文的URL不合法

taobao://s.taobao.com?q=中文

正确的应该是把中文编码一下

taobao://s.taobao.com?q=urlencode(中文)

然后拼到bark参数里,因为整个taobao URL有特殊字符,所以也要URL编码一下

https://bark.xxx.xx/key/title/content?url=urlencode( taobao://s.taobao.com?q=urlencode(中文) )

其中 urlencode 是URL编码的方法

<!-- gh-comment-id:1649110399 --> @Finb commented on GitHub (Jul 25, 2023): 首先要规范taobao 的URL,下面是对的 ``` taobao://s.taobao.com?q=abcd ``` 下面的是错误的,有中文的URL不合法 ``` taobao://s.taobao.com?q=中文 ``` 正确的应该是把中文编码一下 ``` taobao://s.taobao.com?q=urlencode(中文) ``` 然后拼到bark参数里,因为整个taobao URL有特殊字符,所以也要URL编码一下 ``` https://bark.xxx.xx/key/title/content?url=urlencode( taobao://s.taobao.com?q=urlencode(中文) ) ``` 其中 urlencode 是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#181
No description provided.