gpt4 book ai didi

iphone - Tomcat 不解码 URL 编码字符串

转载 作者:行者123 更新时间:2023-11-28 21:50:46 24 4
gpt4 key购买 nike

我将 URL 编码数据从我的 iphone 应用程序(使用以下方法编码)发布到 jsp 页面(Tomcat 后面):

- (NSString *)stringByAddingPercentEscapesUsingEncoding:(NSStringEncoding)enc NS_AVAILABLE(10_3, 2_0);

和字符串编码用作参数:NSUTF8StringEncoding

但不知何故,数据被错误解码。

Sample Text : ¥£€>€£

Encoded: %C2%A5%C2%A3%E2%82%AC%3E%E2%82%AC%C2%A3

Received on Cell As SMS: ¥ £ Φ > Φ £

所以,似乎很少有字符没有被编码/解码。

知道吗,我错过了什么?

最佳答案

URI 编码为 UTF-8,但 Tomcat 是 decoding them as ISO-8859-1 .您需要编辑 server.xml 中的连接器设置并添加 URIEncoding="UTF-8" 属性。

关于iphone - Tomcat 不解码 URL 编码字符串,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5197756/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com