aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBibiko <bibiko@eva.mpg.de>2009-10-29 15:08:52 +0000
committerBibiko <bibiko@eva.mpg.de>2009-10-29 15:08:52 +0000
commitc965c29b6ccf39a96a192f5c4bfffa2c0620cefc (patch)
treece050064795b51b7626b693225d21708884ac0f6
parenta6c30d2c54b270b95b1abc59efef42b97174ed12 (diff)
downloadsequelpro-c965c29b6ccf39a96a192f5c4bfffa2c0620cefc.tar.gz
sequelpro-c965c29b6ccf39a96a192f5c4bfffa2c0620cefc.tar.bz2
sequelpro-c965c29b6ccf39a96a192f5c4bfffa2c0620cefc.zip
• as default add the UTF-8 BOM (byte order marker) \xEFBBBF to a MySQL dump file
- this should simplify the loading of such a file in other text editors - to avoid the writing of that BOM one can add to Sequel Pro's preference plist the boolean key “NoBOMforSQLdumpFile” and set it to YES Note: If it turns out that this BOM causes problems one could add a checkbox for it to the NSSavePanel for instance later on.
-rw-r--r--Source/SPConstants.h1
-rw-r--r--Source/SPConstants.m1
-rw-r--r--Source/TableDump.m6
3 files changed, 7 insertions, 1 deletions
diff --git a/Source/SPConstants.h b/Source/SPConstants.h
index 8043f4ba..8bf9fcff 100644
--- a/Source/SPConstants.h
+++ b/Source/SPConstants.h
@@ -125,3 +125,4 @@ extern NSString *SPQueryHistory;
extern NSString *SPDocumentTaskStartNotification;
extern NSString *SPDocumentTaskEndNotification;
extern NSString *SPDefaultFavorite;
+extern NSString *SPNoBOMforSQLdumpFile;
diff --git a/Source/SPConstants.m b/Source/SPConstants.m
index 6e990cf4..62ae7b3b 100644
--- a/Source/SPConstants.m
+++ b/Source/SPConstants.m
@@ -95,3 +95,4 @@ NSString *SPQueryHistory = @"queryHistory";
NSString *SPDocumentTaskStartNotification = @"DocumentTaskStarted";
NSString *SPDocumentTaskEndNotification = @"DocumentTaskEnded";
NSString *SPDefaultFavorite = @"DefaultFavorite";
+NSString *SPNoBOMforSQLdumpFile = @"NoBOMforSQLdumpFile";
diff --git a/Source/TableDump.m b/Source/TableDump.m
index abb2e258..99311518 100644
--- a/Source/TableDump.m
+++ b/Source/TableDump.m
@@ -1300,8 +1300,12 @@
}
}
+
+ // If NoBOMforSQLdumpFile is not set to YES write the UTF-8 Byte Order Marker
+ [metaString setString:([prefs boolForKey:SPNoBOMforSQLdumpFile]) ? @"" : @"\xef\xbb\xbf"];
+
// Add the dump header to the dump file.
- [metaString setString:@"# Sequel Pro dump\n"];
+ [metaString appendString:@"# Sequel Pro dump\n"];
[metaString appendString:[NSString stringWithFormat:@"# Version %@\n",
[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleVersion"]]];
[metaString appendString:@"# http://code.google.com/p/sequel-pro\n#\n"];