다음을 통해 공유


URLDecoder.Decode Method

Definition

Overloads

Decode(String)
Obsolete.

Decodes a x-www-form-urlencoded string.

Decode(String, Charset)

Decodes an application/x-www-form-urlencoded string using a specific java.

Decode(String, String)

Decodes an application/x-www-form-urlencoded string using a specific encoding scheme.

Decode(String)

Caution

deprecated

Decodes a x-www-form-urlencoded string.

[Android.Runtime.Register("decode", "(Ljava/lang/String;)Ljava/lang/String;", "")]
[System.Obsolete("deprecated")]
public static string? Decode (string? s);
[<Android.Runtime.Register("decode", "(Ljava/lang/String;)Ljava/lang/String;", "")>]
[<System.Obsolete("deprecated")>]
static member Decode : string -> string

Parameters

s
String

the String to decode

Returns

the newly decoded String

Attributes

Remarks

Decodes a x-www-form-urlencoded string. The platform's default encoding is used to determine what characters are represented by any consecutive sequences of the form "%xy".

This member is deprecated. The resulting string may vary depending on the platform's default encoding. Instead, use the decode(String,String) method to specify the encoding.

Java documentation for java.net.URLDecoder.decode(java.lang.String).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

Decode(String, Charset)

Decodes an application/x-www-form-urlencoded string using a specific java.

[Android.Runtime.Register("decode", "(Ljava/lang/String;Ljava/nio/charset/Charset;)Ljava/lang/String;", "", ApiSince=33)]
public static string? Decode (string? s, Java.Nio.Charset.Charset? charset);
[<Android.Runtime.Register("decode", "(Ljava/lang/String;Ljava/nio/charset/Charset;)Ljava/lang/String;", "", ApiSince=33)>]
static member Decode : string * Java.Nio.Charset.Charset -> string

Parameters

s
String

the String to decode

charset
Charset

the given charset

Returns

the newly decoded String

Attributes

Remarks

Decodes an application/x-www-form-urlencoded string using a specific java.nio.charset.Charset Charset. The supplied charset is used to determine what characters are represented by any consecutive sequences of the form "%xy".

<em><strong>Note:</strong> The World Wide Web Consortium Recommendation states that UTF-8 should be used. Not doing so may introduce incompatibilities.</em>

Added in 10.

Java documentation for java.net.URLDecoder.decode(java.lang.String, java.nio.charset.Charset).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

Decode(String, String)

Decodes an application/x-www-form-urlencoded string using a specific encoding scheme.

[Android.Runtime.Register("decode", "(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;", "")]
public static string? Decode (string? s, string? enc);
[<Android.Runtime.Register("decode", "(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;", "")>]
static member Decode : string * string -> string

Parameters

s
String

the String to decode

enc
String

The name of a supported character encoding.

Returns

the newly decoded String

Attributes

Exceptions

if charsetName is not supported.

Remarks

Decodes an application/x-www-form-urlencoded string using a specific encoding scheme.

This method behaves the same as String decode(String s, Charset charset) except that it will java.nio.charset.Charset#forName look up the charset using the given encoding name.

Added in 1.4.

Java documentation for java.net.URLDecoder.decode(java.lang.String, java.lang.String).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to