简体   繁体   中英

How do decode html data in ios?

I have data in the form :

%3Cp%3E%3Cstrong%3Ee-AWB+and+e

I have to decode this and display in a Webview/UILabel!

I have tried this - URL Decoding , but it isn't working for me

Use this -

- (NSString *)URLDecode:(NSString *)htmlString
{
    NSString *decodedURL = [htmlString stringByReplacingOccurrencesOfString:@"+" withString:@" "];
    decodedURL = [decodedURL stringByRemovingPercentEncoding];
    return decodedURL;
}

Here you get the output as - <p><strong>e-AWB and e

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM