Share via


UrlEncodeAsUrl(String, Boolean) Method

The UrlEncodeAsUrl method of the SPEncode class encodes the specified string, converting special characters to quoted UTF-8 format, but assumes that the string is a path component of a URL and encodes Unicode characters only if encodeUnicodeCharacters is true.

Parameters

str   The string to encode as a URL.

encodeUnicodeCharacters  true to encode Unicode characters; otherwise, false.

Return Value

The encoded string.

Remarks

Unlike the UrlEncode method, the UrlEncodeAsUrl method does not encode the forward slash ("/").

Requirements

Platforms: Microsoft Windows Server 2003

Security: Code Access Security