开发者

remove html characters in blackberry java [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 11 year开发者_如何学运维s ago.

how to remove html characters in a webservice in blackberry java ? (ie remove "$" withString "%24" and "&" withString "%26" and so on..)


You would use one of the many freely-available URL encoders. Search for "blackberry url encoder" or "java me url encoder" or something similar. For example, here's one and here's another.

It's always been a mystery to me why URL encoding and decoding was not included in either MIDP or the BlackBerry API given that it's so useful.


String s="http://199.199.199.199/webservices/login.php";
int b = (int)s.charAt(i++);
if ((b>=0x30 && b<=0x39) || (b>=0x41 && b<=0x5A) || (b>=0x61 && b<=0x7A)) {
tmp.append((char)b);
}
else {
tmp.append("%");
if (b <= 0xf) tmp.append("0");
tmp.append(Integer.toHexString(b));
}
Dialog.alert(tmp.toString());
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜