gpt4 book ai didi

c# - 哪些字符没有得到编码?

转载 作者:太空狗 更新时间:2023-10-30 00:45:25 25 4
gpt4 key购买 nike

所以我在 C# 中构建一个 WebAPI,当我使用

编码我的字符串时

Uri.EscapeDataString(字符串)

有些字符没有像 ! 那样编码。

我很好奇是否有一个列表列出所有那些没有被编码的​​字符是什么因为用户几乎可以传递任何东西。所以我可以创建一个异常并自己手动编码。

提前致谢!

最佳答案

MSDN Uri.EscapeDataString 方法的页面说:

By default, the EscapeDataString method converts all characters except for RFC 2396 unreserved characters to their hexadecimal representation.

RFC 2396在第 2.3 章中说。非保留字符:

  unreserved  = alphanum | mark

mark = "-" | "_" | "." | "!" | "~" | "*" | "'" | "(" | ")"

关于c# - 哪些字符没有得到编码?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5505921/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com