[sword-svn] r2139 - trunk/utilities

dmsmith at www.crosswire.org dmsmith at www.crosswire.org
Fri Feb 29 07:29:58 MST 2008


Author: dmsmith
Date: 2008-02-29 07:29:57 -0700 (Fri, 29 Feb 2008)
New Revision: 2139

Modified:
   trunk/utilities/osis2mod.cpp
Log:
made nfc normalization the default for osis2mod

Modified: trunk/utilities/osis2mod.cpp
===================================================================
--- trunk/utilities/osis2mod.cpp	2008-02-28 20:31:44 UTC (rev 2138)
+++ trunk/utilities/osis2mod.cpp	2008-02-29 14:29:57 UTC (rev 2139)
@@ -61,7 +61,7 @@
 	"Jude", "Rev"};
 
 static bool inCanonicalOSISBook = true; // osisID is for a book that is not in Sword's canon
-static bool normalize = false; // Whether to normalize UTF-8 to NFC
+static bool normalize = true; // Whether to normalize UTF-8 to NFC
 
 bool isOSISAbbrev(const char *buf) {
 	bool match = false;
@@ -775,7 +775,8 @@
 	fprintf(stderr, "\t\t\t\t 2 - verse; 3 - chapter; 4 - book\n");
 	fprintf(stderr, "  -c <cipher_key>\t encipher module using supplied key\n");
 	fprintf(stderr, "\t\t\t\t (default no enciphering)\n");
-	fprintf(stderr, "  -n\t\t\t normalize UTF-8 to NFC (default is to leave text unmodified)\n");
+	fprintf(stderr, "  -N\t\t\t Do not normalize UTF-8 to NFC\n");
+	fprintf(stderr, "\t\t\t\t Note: assumes text is UTF-8\n");
 	fprintf(stderr, "\t\t\t\t Note: all UTF-8 texts should be normalized to NFC\n");
 	exit(-1);
 }
@@ -819,12 +820,8 @@
 			}
 			usage(*argv, "-b requires one of <2|3|4>");
 		}
-		else if (!strcmp(argv[i], "-n")) {
-			normalize = true;
-#ifndef _ICU_
+		else if (!strcmp(argv[i], "-N")) {
 			normalize = false;
-			cout << program << " is not compiled with support for ICU. Ignoring -n flag." << endl;
-#endif
 		}
 		else if (!strcmp(argv[i], "-c")) {
 			if (i+1 < argc) cipherKey = argv[++i];
@@ -839,6 +836,13 @@
 		case 2: compressor = new ZipCompress(); break;
 	}
 
+#ifndef _ICU_
+	if (normalize) {
+		normalize = false;
+		cout << program << " is not compiled with support for ICU. Ignoring -n flag." << endl;
+	}
+#endif
+
 #ifdef DEBUG
 	cout << "path: " << path << " osisDoc: " << osisDoc << " create: " << append << " compressType: " << compType << " blockType: " << iType << " cipherKey: " << cipherKey.c_str() << " normalize: " << normalize << "\n";
 	cout << "";




More information about the sword-cvs mailing list