Reputation: 21
I'm making an iphone application using some Spanish characters. All of these characters are being included on a various text files. The matter is that when I import the data using NSMutableArrays or NSData objects, all the special characters was replaced for strange symbols. I try to solve this problem using for all text files UTF-8 enconder but no changes.
Upvotes: 1
Views: 600
Reputation: 21
Thanks for the tip. I solved the problem. When we're working with spanish characters we need to implement the serializable object with the following method of NSString class:
(id)stringWithContentsOfFile:(NSString *)path encoding:(NSStringEncoding)enc error:(NSError **)error
You'll need to pass "enc". I used "4" and working for me. Regards. Cesar.
Upvotes: 1
Reputation: 36537
Try using different encodings—using UTF-8 will only work if the text is actually in that encoding, which it apparently isn't. For example, try ISO Latin-1 or MacRoman.
Upvotes: 0