-# Copyright (C) 1999-2011, International Business Machines
+# Copyright (C) 1999-2012, International Business Machines
# Corporation and others. All Rights Reserved.
#
# file name: nfc.txt
# machine-generated by ICU preparseucd.py
#
# Complete data for Unicode NFC normalization.
-# Unicode 6.1.0
+
+* Unicode 6.1.0
# Canonical_Combining_Class (ccc) values
0300..0314:230
-# Copyright (C) 1999-2011, International Business Machines
+# Copyright (C) 1999-2012, International Business Machines
# Corporation and others. All Rights Reserved.
#
# file name: nfkc.txt
# machine-generated by ICU preparseucd.py
#
# Complete data for Unicode NFKC normalization.
-# Unicode 6.1.0
+
+* Unicode 6.1.0
# Canonical_Combining_Class (ccc) values
0300..0314:230
/*
*******************************************************************************
*
-* Copyright (C) 2009-2010, International Business Machines
+* Copyright (C) 2009-2012, International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
/* 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 */
LocalPointer<Normalizer2DataBuilder> 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);
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;
/*
*******************************************************************************
*
-* Copyright (C) 2009-2011, International Business Machines
+* Copyright (C) 2009-2012, International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
void
Normalizer2DataBuilder::setUnicodeVersion(const char *v) {
- u_versionFromString(unicodeVersion, v);
+ UVersionInfo nullVersion={ 0, 0, 0, 0 };
+ UVersionInfo version;
+ u_versionFromString(version, v);
+ if( 0!=memcmp(version, unicodeVersion, U_MAX_VERSION_LENGTH) &&
+ 0!=memcmp(nullVersion, unicodeVersion, U_MAX_VERSION_LENGTH)
+ ) {
+ char buffer[U_MAX_VERSION_STRING_LENGTH];
+ u_versionToString(unicodeVersion, buffer);
+ fprintf(stderr, "gennorm2 error: multiple inconsistent Unicode version numbers %s vs. %s\n",
+ buffer, v);
+ exit(U_ILLEGAL_ARGUMENT_ERROR);
+ }
+ memcpy(unicodeVersion, version, U_MAX_VERSION_LENGTH);
}
Norm *Normalizer2DataBuilder::allocNorm() {
printf("minMaybeYes: 0x%04x\n", (int)indexes[Normalizer2Impl::IX_MIN_MAYBE_YES]);
}
+ UVersionInfo nullVersion={ 0, 0, 0, 0 };
+ if(0==memcmp(nullVersion, unicodeVersion, 4)) {
+ u_versionFromString(unicodeVersion, U_UNICODE_VERSION);
+ }
memcpy(dataInfo.dataVersion, unicodeVersion, 4);
UNewDataMemory *pData=
udata_create(NULL, NULL, filename, &dataInfo,