Skip to content
Snippets Groups Projects
Commit 4c076269 authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

use ASCII if UTF8 failed

parent a8dcf02e
No related branches found
No related tags found
No related merge requests found
......@@ -39,6 +39,7 @@
if(self.fileToEdit){
NSData *fileData = [NSData dataWithContentsOfFile:self.fileToEdit];
NSString* aStr = [[NSString alloc] initWithData:fileData encoding:NSUTF8StringEncoding];
if(!aStr) aStr = [[NSString alloc] initWithData:fileData encoding:NSASCIIStringEncoding];
[self.aboutView loadHTMLString:[NSString stringWithFormat:@"<html><body><pre contenteditable=\"true\">%@</pre></body></html>", aStr] baseURL:[[NSBundle mainBundle] bundleURL]];
UIBarButtonItem *save = [[UIBarButtonItem alloc] initWithTitle:@"Save" style:UIBarButtonItemStylePlain target:self action:@selector(saveFile)];
[self.navigationItem setRightBarButtonItems:[NSArray arrayWithObjects: save, nil]];
......
......@@ -54,6 +54,7 @@
<array>
<string>opengles-1</string>
</array>
<key>ITSAppUsesNonExemptEncryption</key><false/>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment