简体   繁体   English

NSString转换百分比字符

[英]NSString converting percentage characters

I have an NSString *str = @"T%B3%C3%83"; 我有一个NSString * str = @“ T%B3%C3%83”;

where %C3 represents A with an umlut (I think), %B3 an m, %83 a superscript 3... 其中%C3代表A的总和,%B3一个m,%83一个上标3 ...

What is the best way to convert these percentages into the actual characters. 将这些百分比转换为实际字符的最佳方法是什么。

Thanks. 谢谢。

use -stringByReplacingPercentEscapesUsingEncoding method in NSString. 在NSString中使用-stringByReplacingPercentEscapesUsingEncoding方法。
PS However I don't know what encoding you must use to get results you've mentioned in your question (are you sure they're correct?) PS但是我不知道您必须使用哪种编码来获得问题中提到的结果(您确定它们正确吗?)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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