99 |
public static String encode(String s, String encoding) |
public static String encode(String s, String encoding) |
100 |
throws UnsupportedEncodingException |
throws UnsupportedEncodingException |
101 |
{ |
{ |
|
StringBuffer result = new StringBuffer(); |
|
102 |
int length = s.length(); |
int length = s.length(); |
103 |
int start = 0; |
int start = 0; |
104 |
int i = 0; |
int i = 0; |
105 |
|
|
106 |
|
StringBuffer result = new StringBuffer(length); |
107 |
while (true) |
while (true) |
108 |
{ |
{ |
109 |
while ( i < length && isSafe(s.charAt(i)) ) |
while ( i < length && isSafe(s.charAt(i)) ) |