Monday, August 15, 2011

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

The android.net.Uri class provide a method encode() to encode 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.

example:
        String src = "ABC def";

String dest = Uri.encode(src);


It convert "ABC def" to "ABC%20def"

No comments: