Follow encodeURIComponent rules strictly#5250
Merged
2dust merged 1 commit into2dust:masterfrom Feb 6, 2026
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
对齐 v2rayN 和 v2rayNG 在 URL 编码/解码上的行为,
减少跨平台使用时的差异和用户困惑。
目前规范要求使用 encodeURIComponent 的编码规则,
即空格使用 "%20","+" 表示字面量加号。
但在解码阶段,v2rayNG 等实现仍然兼容将 "+" 解析为空格,
这会导致编码和解码遵循了不同的语义。
在实际使用中,这种差异会带来一些问题:
部分服务或面板会输出 "+" 表示空格,
而这些数据在非 Android / 非 Java 生态中往往无法被正确解析,
最终表现为“在某些平台可用,在另一些平台不可用”。
因此这里尝试统一编码和解码的行为,使其都严格遵循
encodeURIComponent / RFC 3986 的语义,以减少平台间差异,
也让与其他语言实现的互操作更加可预期。