X-Git-Url: https://git.saurik.com/apple/icu.git/blobdiff_plain/729e4ab9bc6618bc3d8a898e575df7f4019e29ca..586446045a9ad027ace9532db9e32639f87706dd:/icuSources/tools/gennorm2/gennorm2.cpp diff --git a/icuSources/tools/gennorm2/gennorm2.cpp b/icuSources/tools/gennorm2/gennorm2.cpp index f0d981ec..597300da 100644 --- a/icuSources/tools/gennorm2/gennorm2.cpp +++ b/icuSources/tools/gennorm2/gennorm2.cpp @@ -1,7 +1,7 @@ /* ******************************************************************************* * -* Copyright (C) 2009-2010, International Business Machines +* Copyright (C) 2009-2012, International Business Machines * Corporation and others. All Rights Reserved. * ******************************************************************************* @@ -80,7 +80,6 @@ main(int argc, char* argv[]) { /* preset then read command line options */ options[SOURCEDIR].value=""; - options[UNICODE_VERSION].value=U_UNICODE_VERSION; argc=u_parseArgs(argc, argv, sizeof(options)/sizeof(options[HELP_H]), options); /* error handling, printing usage message */ @@ -145,7 +144,9 @@ main(int argc, char* argv[]) { LocalPointer builder(new Normalizer2DataBuilder(errorCode)); errorCode.assertSuccess(); - builder->setUnicodeVersion(options[UNICODE_VERSION].value); + if(options[UNICODE_VERSION].doesOccur) { + builder->setUnicodeVersion(options[UNICODE_VERSION].value); + } if(options[OPT_FAST].doesOccur) { builder->setOptimization(Normalizer2DataBuilder::OPTIMIZE_FAST); @@ -198,6 +199,11 @@ void parseFile(FILE *f, Normalizer2DataBuilder &builder) { continue; // skip empty and comment-only lines } if(line[0]=='*') { + const char *s=u_skipWhitespace(line+1); + if(0==strncmp(s, "Unicode", 7)) { + s=u_skipWhitespace(s+7); + builder.setUnicodeVersion(s); + } continue; // reserved syntax } const char *delimiter;