ObjFW  Diff

Differences From Artifact [b7816611b8]:

To Artifact [6d858b8401]:


2707
2708
2709
2710
2711
2712
2713
































2714
2715
2716
2717
2718
2719
2720
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752







+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+








	if (byteOrder != OF_BYTE_ORDER_NATIVE)
		for (size_t i = 0; i < length; i++)
			ret[i] = OF_BSWAP32(ret[i]);

	return ret;
}

#ifdef OF_HAVE_UNICODE_TABLES
- (OFString *)decomposedStringWithCanonicalMapping
{
	OFMutableString *ret = [OFMutableString string];
	void *pool = objc_autoreleasePoolPush();
	const of_unichar_t *characters = [self characters];
	size_t length = [self length];

	for (size_t i = 0; i < length; i++) {
		of_unichar_t c = characters[i];
		const char *const *table;

		if (c >= OF_UNICODE_DECOMPOSITION_TABLE_SIZE) {
			[ret appendCharacters: &c
				       length: 1];
			continue;
		}

		table = of_unicode_decomposition_table[c >> 8];
		if (table != NULL && table[c & 0xFF] != NULL)
			[ret appendUTF8String: table[c & 0xFF]];
		else
			[ret appendCharacters: &c
				       length: 1];
	}

	objc_autoreleasePoolPop(pool);

	return ret;
}
#endif

#ifdef OF_HAVE_FILES
- (void)writeToFile: (OFString *)path
{
	[self writeToFile: path
		 encoding: OF_STRING_ENCODING_UTF_8];
}