Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/sql-server-2005/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Iphone 如何在我的应用程序中处理西班牙语字符?_Iphone_Objective C_Encoding - Fatal编程技术网

Iphone 如何在我的应用程序中处理西班牙语字符?

Iphone 如何在我的应用程序中处理西班牙语字符?,iphone,objective-c,encoding,Iphone,Objective C,Encoding,在我的应用程序中,我有一个支持西班牙语并以西班牙语返回结果的服务。 现在,我正试图将一些搜索词传递给这个服务,以获取返回的结果,但它失败了,因为在发送时,编译器会将该词转换为具有未知字符的有趣单词。 我正在这样做: 这里的名字是西班牙语的,但当我在配置字典中添加它时,它又被转换成了一些有趣的东西 -(void)perfromLocationSearchWithName:(NSString *)name{ NSData * nameCode = [[NSData alloc]init];

在我的应用程序中,我有一个支持西班牙语并以西班牙语返回结果的服务。 现在,我正试图将一些搜索词传递给这个服务,以获取返回的结果,但它失败了,因为在发送时,编译器会将该词转换为具有未知字符的有趣单词。 我正在这样做: 这里的名字是西班牙语的,但当我在配置字典中添加它时,它又被转换成了一些有趣的东西

-(void)perfromLocationSearchWithName:(NSString *)name{

    NSData * nameCode = [[NSData alloc]init];
    nameCode = [name dataUsingEncoding:NSUTF8StringEncoding allowLossyConversion:YES];
    NSString * namePass = [[NSString alloc]initWithData:nameCode encoding:NSUTF8StringEncoding];
    NSLog(@"Name:%@",namePass);

    NSMutableDictionary *config = [[[NSMutableDictionary alloc] initWithCapacity:4] autorelease];
    NSString * strAction = [NSString stringWithFormat:@"vendorSearchByName"];
    if (namePass !=nil){
        [config setObject:namePass forKey:@"vendorName"];
        //[config setObject:@"001" forKey:@"MakeCode"];
        [config setObject:@"5" forKey:@"maxCount"];
        [config setObject:strAction forKey:@"action"];
    }
    NSLog(@"Dict%@",[config description]);
    comm = [[CommManager alloc] init];
    [comm searchDealerLocationWithOptions:config withDelegate:self];
    [namePass release];
}
请帮忙
谢谢,

尝试使用
nsisolatin1stringecoding
。在我们的应用程序中帮助了我们。

它仍在做同样的事情。字符串namePass给出了确切的字符串,但当我将其添加到config和nslog以检查结果时,带重音的字母被替换为4-5个特殊字符