Skip to content

Comments

Follow encodeURIComponent rules strictly#5250

Merged
2dust merged 1 commit into2dust:masterfrom
DHR60:fix2
Feb 6, 2026
Merged

Follow encodeURIComponent rules strictly#5250
2dust merged 1 commit into2dust:masterfrom
DHR60:fix2

Conversation

@DHR60
Copy link
Contributor

@DHR60 DHR60 commented Feb 2, 2026

对齐 v2rayN 和 v2rayNG 在 URL 编码/解码上的行为,
减少跨平台使用时的差异和用户困惑。

目前规范要求使用 encodeURIComponent 的编码规则,
即空格使用 "%20","+" 表示字面量加号。
但在解码阶段,v2rayNG 等实现仍然兼容将 "+" 解析为空格,
这会导致编码和解码遵循了不同的语义。

在实际使用中,这种差异会带来一些问题:
部分服务或面板会输出 "+" 表示空格,
而这些数据在非 Android / 非 Java 生态中往往无法被正确解析,
最终表现为“在某些平台可用,在另一些平台不可用”。

因此这里尝试统一编码和解码的行为,使其都严格遵循
encodeURIComponent / RFC 3986 的语义,以减少平台间差异,
也让与其他语言实现的互操作更加可预期。

@2dust 2dust merged commit f482533 into 2dust:master Feb 6, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants