UILabel 文本中的加号

发布于 2024-12-04 19:05:16 字数 158 浏览 3 评论 0原文

我有一个iPhone应用程序,它使用core.data作为其存储和休息API(基于apache jersey)。

它检索数据,将其保存到 core.data,然后在应用程序上显示数据。

我遇到的问题是空格被替换为+号...

这是来自其余服务的编码问题吗?

I have an iPhone app that uses core.data as its storage and a rest api (apache jersey based).

it retrieves data, saves it to core.data and then displays the data on the app.

The problem i have is that the spaces are replaced with + signs...

Is this an encoding issue that comes from the rest service?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

少钕鈤記 2024-12-11 19:05:16

是的,该字符串已经过 URL 编码。空格被替换为+号。非字母数字字符将替换为其 ASCII 等效字符。

我相信你想使用解码它

- (NSString *)stringByReplacingPercentEscapesUsingEncoding:(NSStringEncoding)encoding

Yes, that string has been URL Encoded. Spaces are replaced with + signs. Non alpha numeric characters are replaced by their ASCII equivalents.

I believe you want to decode it using

- (NSString *)stringByReplacingPercentEscapesUsingEncoding:(NSStringEncoding)encoding
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文