开发者

Handling special characters in domain names (without IDN)?

I am using the URI class to break apart a string url.

The getHost() method returns null when there are special characters in it.

Such as: http://✪df.ws/g44

It was suggested to use the IDN class to work around this. However, that class is only available in the Android API level 9 and above, which means 2.3 and above.

Is there another way to do this without the IDN class?

I want to be able to break apart a string url into t开发者_开发问答he various pieces and be able to handle modern urls.

Thanks

Update It looks like the WebView doesn't support these types of urls either. So, it looks like I need to find a way to support or convert these urls for pre 2.3 devices.

Is there a way to convert these urls without the IDN class?


getHost() = ignore everything from the start until :// and then capture everything until you get a slash.

Wouldn't that work?

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜