* Environment.cs : bump corlib version.
* Normalization.cs : For NFC and NFKC, IsNormalized() was not working
enough to check composed characters. It's not possible without
the actual composition, so just call Normalize() and compare them.
In Normalize() mapping helper didn't pick correct map index since
the table for index stores index for "uncompressed" numbers.
* NormalizationTableUtil.cs : updated to the latest UCD.
* Makefile : to build test, source file must be downloaded too.
* StringTest.cs : added string normalization test.
svn path=/trunk/mcs/; revision=136100
+2008-06-15 Atsushi Enomoto <atsushi@ximian.com>
+
+ * Normalization.cs : For NFC and NFKC, IsNormalized() was not working
+ enough to check composed characters. It's not possible without
+ the actual composition, so just call Normalize() and compare them.
+ In Normalize() mapping helper didn't pick correct map index since
+ the table for index stores index for "uncompressed" numbers.
+ * NormalizationTableUtil.cs : updated to the latest UCD.
+ * Makefile : to build test, source file must be downloaded too.
+
2008-11-05 Atsushi Enomoto <atsushi@ximian.com>
* ucd.cs : Write type for *_count. Add notice to not edit
collation : $(MSCOMPAT_FILENAME)
-norm-test : $(NORM_TEST_CS)
+norm-test : $(NORM_TEST_CS) $(NORM_TEST)
$(CS2COMPILE) $(NORM_TEST_CS) -d:TEST_STANDALONE
distclean :
# normalization (including combining class)
$(NORM_FILENAME) : $(NORMGEN_FILENAME).exe Normalization.cs $(NORM_TABLE) $(UCD_TABLE) $(CB_CLASS_TABLE)
echo "// WARNING: Do not edit this file. It is autogenerated." > $(NORM_FILENAME)
- echo "#define GENERATE_TABLE" > $(NORM_FILENAME)
- cat Normalization.cs >> $(NORM_FILENAME) || rm $(NORM_FILENAME)
- $(RUNTIME) $(NORMGEN_FILENAME).exe >> $(NORM_FILENAME) || rm $(NORM_FILENAME)
- echo " }" >> $(NORM_FILENAME)
- echo "}" >> $(NORM_FILENAME)
+ echo "#define GENERATE_TABLE" >> $(NORM_FILENAME); \
+ cat Normalization.cs >> $(NORM_FILENAME); \
+ $(RUNTIME) $(NORMGEN_FILENAME).exe >> $(NORM_FILENAME); \
+ echo " }" >> $(NORM_FILENAME); \
+ echo "}" >> $(NORM_FILENAME) || rm $(NORM_FILENAME)
NORM_TABLE_GENERATOR_SOURCES = \
$(NORMGEN_FILENAME).cs \
return mapIdxToComposite [NUtil.Composite.ToIndex (src)];
}
- static short GetPrimaryCompositeHelperIndex (int cp)
+ static int GetPrimaryCompositeHelperIndex (int cp)
{
- return helperIndex [NUtil.Helper.ToIndex (cp)];
+ int originalMapIndex = helperIndex [NUtil.Helper.ToIndex (cp)]; // it returns an index at uncompressed state.
+ return NUtil.Map.ToIndex (originalMapIndex);
}
static int GetPrimaryCompositeCharIndex (object chars, int start)
case NormalizationCheck.No:
return false;
case NormalizationCheck.Maybe:
+ // for those forms with composition, it cannot be checked here
+ switch (type) {
+ case 0: // NFC
+ case 2: // NFKC
+ return source == Normalize (source, type);
+ }
+ // go on...
+
// partly copied from Combine()
int cur = i;
// FIXME: It should check "blocked" too
static NormalizationTableUtil ()
{
int [] propStarts = new int [] {
- 0, 0x0910, 0x1D00, 0x2460, 0x2980,
- 0x2D60, 0x2E90, 0xF900,
+ 0, 0x0910, 0x1B00, 0x2460, 0x2980,
+ 0x2C70, 0x2D60, 0x2E90, 0xA770, 0xF900,
// 0x1D100, 0x2f800, 0x2fa10
};
int [] propEnds = new int [] {
0x06E0, 0x1200, 0x2330, 0x2600, 0x2AE0,
- 0x2D70, 0x3400, 0x10000,
+ 0x2C80, 0x2D70, 0x3400, 0xA780, 0x10000,
// 0x1D800, 0x2f810, 0x2fa20
};
int [] mapStarts = new int [] {
+2009-06-15 Atsushi Enomoto <atsushi@ximian.com>
+
+ * Environment.cs : bump corlib version.
+
2009-06-12 Bill Holmes <billholmes54@gmail.com>
* Variant.cs (GetValue): Changing the bool case to use the short value.
* Changes which are already detected at runtime, like the addition
* of icalls, do not require an increment.
*/
- private const int mono_corlib_version = 77;
+ private const int mono_corlib_version = 78;
#if NET_2_0
[ComVisible (true)]
+2009-06-15 Atsushi Enomoto <atsushi@ximian.com>
+
+ * StringTest.cs : added string normalization test.
+
2009-05-26 Rodrigo Kumpera <rkumpera@novell.com>
* TypeTest.cs: test for bug #506757.
// Authors:
// Jeffrey Stedfast <fejj@ximian.com>
// David Brandt <bucky@keystreams.com>
-// Kornél Pál <http://www.kornelpal.hu/>
+// Kornel Pal <http://www.kornelpal.hu/>
//
// (C) Ximian, Inc. http://www.ximian.com
-// Copyright (C) 2006 Kornél Pál
+// Copyright (C) 2006 Kornel Pal
// Copyright (C) 2006 Novell (http://www.novell.com)
//
AssertEquals ("#11-09-2", "..", res[1]);
AssertEquals ("#11-09-3", 2, res.Length);
}
+
+ [Test]
+ public void Normalize1 ()
+ {
+ string s = "\u03B1\u0313\u0345";
+ Assert ("#1", s.IsNormalized (s, NormalizationForm.FormC));
+ AssertEquals ("#2", s, s.Normalize (NormalizationForm.FormC));
+ }
#endif
}