Share via


Uri.Encode Method

Definition

Overloads

Encode(String)

Encodes characters in the given string as '%'-escaped octets using the UTF-8 scheme.

Encode(String, String)

Encodes characters in the given string as '%'-escaped octets using the UTF-8 scheme.

Encode(String)

Encodes characters in the given string as '%'-escaped octets using the UTF-8 scheme.

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

Parameters

s
String

string to encode

Returns

an encoded version of s suitable for use as a URI component, or null if s is null

Attributes

Remarks

Encodes characters in the given string as '%'-escaped octets using the UTF-8 scheme. Leaves letters ("A-Z", "a-z"), numbers ("0-9"), and unreserved characters ("_-!.~'()*") intact. Encodes all other characters.

Java documentation for android.net.Uri.encode(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

Encode(String, String)

Encodes characters in the given string as '%'-escaped octets using the UTF-8 scheme.

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

Parameters

s
String

string to encode

allow
String

set of additional characters to allow in the encoded form, null if no characters should be skipped

Returns

an encoded version of s suitable for use as a URI component, or null if s is null

Attributes

Remarks

Encodes characters in the given string as '%'-escaped octets using the UTF-8 scheme. Leaves letters ("A-Z", "a-z"), numbers ("0-9"), and unreserved characters ("_-!.~'()*") intact. Encodes all other characters with the exception of those specified in the allow argument.

Java documentation for android.net.Uri.encode(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