Great God Come ah, rookie neighborhoods
Thank you
Reply:
In principle, objective-c built-in support Chinese, so read, display Chinese is no problem.
So I guess if you're reading from a text file, string, and then transformed into NSString, then this process is dictation parameter is not set right, please put your relevant code stickers,
Reply:
Chant transcoding problem, we must first know what the contents of the file using the encoding format, and then convert Iphone can be displayed.
Reply:
Use UTF-8 on the line can ah
Reply:
3Q, the key is a simple text (in English and have a) do not know what encoding ah
NSArray * pathArray = NSSearchPathForDirectoriesInDomains (NSDocumentDirectory, NSUserDomainMask, YES);
/ / Get the full path
documentsNSString * documentDirectory = [pathArray objectAtIndex: 0];
/ / The full path
a.txtNSString * filePath = [documentDirectory stringByAppendingPathComponent: [NSString stringWithFormat: @ "a.txt"]];
/ / Read the contents of the string assigned to
NSString * text = [NSString stringWithContentsOfFile: filePath];
/ / Display
in another page in textView. . .
The problem is a mess Chinese display. .
Reply:
I guess you encounter a problem I encountered, please try the following methods to open your file in WordPad, and then select File Save As, in the preservation of the time, the bottom has a coding options, select utf -8, or unicode, so I do not remember, and then save it, into the project, at compile time.
Reply:
Thank you upstairs, really can!
But I was wondering, but also save the settings for each format of the text,
It does not seem realistic wow
No comments:
Post a Comment