我已尝试使用StringByAddingPercent
,但获得的效果如图所示。
以下是我收到的错误消息:
我也通过添加百分比来尝试字符串,但它返回类似%2A
的内容并将其保存在SQL数据库中而不是阿拉伯语单词中。
NSString* source = [NSString stringWithFormat:@"http://192.168.227.1/student/Service1.svc/insertTasbeeh/سُبْحَانَ اللّهِ/1000"];
NSURL *url = [NSURL URLWithString:source];
答案 0 :(得分:1)
试试这个:
=if constants!$[Row()][Column()] = 0, <Loop around and fetch the equivalent Value>, <constants!$[Row()][Column()]>)
希望这能帮到你!
更新解码网址:
NSString *string = @"http://192.168.227.1/student/Service1.svc/insertTasbeeh/سُبْحَانَ اللّهِ/1000";
NSLog(@"url with string! %@", [NSURL URLWithString:string]);
NSLog(@"url with escaped string! %@", [NSURL URLWithString:
[string stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]]);
答案 1 :(得分:0)
NSURL *url = [NSURL URLWithString:[@"http://192.168.227.1/student/Service1.svc/insertTasbeeh/سُبْحَانَ اللّهِ/1000" stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
这应该有用。
答案 2 :(得分:0)
下面的线将做魔术
NSURL *url = [NSURL URLWithString:
[source stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]
];
您需要在制作网址之前进行编码。
答案 3 :(得分:0)
快速版本:
self.url =“ http://192.168.227.1/student/Service1.svc/insertTasbeeh/سُبْحَانَ اللّهِ / 1000”。addingPercentEncoding(withAllowedCharacters:.urlQueryAllowed)