Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iphone 4s真机ios8下,系统语言为简体中文,拼音返回的是中文,没有转成拼音。 #9

Open
OuIChien opened this issue Jan 30, 2015 · 3 comments

Comments

@OuIChien
Copy link

iphone 4s真机ios8下,系统语言为简体中文,拼音返回的是中文,没有转成拼音。
但虚拟机上,系统语言为英语,是可以的。

@OuIChien
Copy link
Author

已找到原因:
在真机ios8下调试时发现,换行符是\n而不是\r\n,修改下面代码后运行正常了:
ChineseToPinyinResource.m文件的initializeResource方法中,把

@OuIChien
Copy link
Author


NSArray *lines = [dictionaryText componentsSeparatedByString:@"\r\n"];
替换成
NSArray *lines = [dictionaryText componentsSeparatedByString:@"\r\n"];
if (lines.count < 10)
lines = [dictionaryText componentsSeparatedByString:@"\n"];

@JanzTam
Copy link

JanzTam commented Nov 7, 2015

Xcode7真机调试,拼音返回的是中文,没有转成拼音。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants