iOS特殊字符,奇怪的问题 [英] iOS special characters, strange issue

查看:66
本文介绍了iOS特殊字符,奇怪的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到了一个非常奇怪的问题.大约三年前,我启动了一个iOS应用程序(iOS-SDK 3.0),此后便通过了SDK 4.0和5.0.从5.0(也许是5.1)开始,我突然开始遇到德国特殊字符(äöüß)的问题.

I've got a very strange issue. I started an iOS App about three years ago (iOS-SDK 3.0), and since then went through the SDKs 4.0 and 5.0. Since 5.0 (or maybe 5.1) I suddenly started having problems with German special chars (ä ö ü ß).

现在我什至不能用特殊字符初始化NSString,

Now I can't even initialize an NSString with special chars, this line:

NSString *str = @"abcäxyz";

给出以下警告:

由于输入字节不属于输入代码集UTF-8,输入转换已停止

Input conversion stopped due to an input byte that does not belong to the input codeset UTF-8

还有一个:

NSLog(@"%@", strTemp);

给予:

abc

因此,它在第一个特殊字符处停止.在其他项目中,一切都很好.我可以毫无特殊问题地使用特殊字符.

So it's stopping at the first special char. In other projects everything is fine. I can work with special chars without any problems.

这是配置问题吗?

显然是文件编码有问题.

Obviously it is a problem with the file encoding.

文件-I myFile

file -I myFile


正在给予:


is giving:

text/x-c ++;charset = unknown-8bit

text/x-c++; charset=unknown-8bit

尝试使用iconv进行转换会给我:

Trying to convert it with iconv gives me:

不支持从未知的8位转换

conversion from unknown-8bit unsupported

推荐答案

已解决:更改了Xcode中的文件编码:单击要更改其编码的文件,然后打开右面板(此窗格的名称实际上是什么?有什么想法吗?)以编辑属性.在那里,您可以在文本设置"下看到文本编码".就是这样.

SOLVED: Changed the file encoding in Xcode: Click on the file you want to change the encoding of, then open the right panel (whats the name of this pane actually? any idea?) to edit the properties. There you see "Text Encoding" under "Text Settings". That is all.

这篇关于iOS特殊字符,奇怪的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆