doc file created in iPhone documents encoding issue
- by Saurabh Verma
I'm trying to write a MSword file in document directory by the following code:
NSArray* paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory , NSUserDomainMask, YES);
NSString* path;
NSString* gradeDoc = [self fetchCommentsDesc];
NSString* str = [self.objStudent.strName stringByAppendingFormat:@".doc"];
path = [[paths objectAtIndex:0] stringByAppendingPathComponent:str];
[gradeDoc writeToFile:path atomically:YES encoding:NSUTF8StringEncoding error:nil];
[self fetchCommentsDesc] returns NSString.
self.student.strName is a String
Issue:
When i Open the doc file created in document directory of iphone, all the special characters in the doc appears as boxes or some arabic chars.
Please help!