HttpUtility.UrlEncodeUnicodeToBytes(String) 方法

定义

注意

This method produces non-standards-compliant output and has interoperability issues. The preferred alternative is UrlEncodeToBytes(String).

将 Unicode 字符串转换为字节数组。

public:
 static cli::array <System::Byte> ^ UrlEncodeUnicodeToBytes(System::String ^ str);
public static byte[]? UrlEncodeUnicodeToBytes (string? str);
[System.Obsolete("This method produces non-standards-compliant output and has interoperability issues. The preferred alternative is UrlEncodeToBytes(String).")]
public static byte[]? UrlEncodeUnicodeToBytes (string? str);
[System.Obsolete("This method produces non-standards-compliant output and has interoperability issues. The preferred alternative is UrlEncodeToBytes(String).")]
public static byte[] UrlEncodeUnicodeToBytes (string str);
public static byte[] UrlEncodeUnicodeToBytes (string str);
static member UrlEncodeUnicodeToBytes : string -> byte[]
[<System.Obsolete("This method produces non-standards-compliant output and has interoperability issues. The preferred alternative is UrlEncodeToBytes(String).")>]
static member UrlEncodeUnicodeToBytes : string -> byte[]
Public Shared Function UrlEncodeUnicodeToBytes (str As String) As Byte()

参数

str
String

要转换的字符串。

返回

Byte[]

一个字节数组。

属性

注解

如果在 HTTP 流中传递空格和标点符号等字符,则可能会在接收端被错误解释。 URL 编码将 URL 中无效的字符转换为字符实体等效项;URL 解码会反转编码。 例如,当嵌入要通过 URL 传输的文本块中时,字符 < 和 > 将编码为 %3c 和 %3e。

适用于

另请参阅