ObjFW  Diff

Differences From Artifact [e2512a1c1d]:

To Artifact [32655d5053]:


97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
				_s->cString[i] = t;
		}

		return;
	}

	unicodeLen = self.length;
	unicodeString = of_malloc(unicodeLen, sizeof(of_unichar_t));

	i = j = 0;
	newCStringLength = 0;

	while (i < _s->cStringLength) {
		const of_unichar_t *const *table;
		size_t tableSize;







|







97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
				_s->cString[i] = t;
		}

		return;
	}

	unicodeLen = self.length;
	unicodeString = of_alloc(unicodeLen, sizeof(of_unichar_t));

	i = j = 0;
	newCStringLength = 0;

	while (i < _s->cStringLength) {
		const of_unichar_t *const *table;
		size_t tableSize;
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
			@throw [OFInvalidEncodingException exception];
		}

		i += cLen;
	}

	@try {
		newCString = of_malloc(newCStringLength + 1, 1);
	} @catch (id e) {
		free(unicodeString);
		@throw e;
	}

	j = 0;








|







151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
			@throw [OFInvalidEncodingException exception];
		}

		i += cLen;
	}

	@try {
		newCString = of_alloc(newCStringLength + 1, 1);
	} @catch (id e) {
		free(unicodeString);
		@throw e;
	}

	j = 0;

371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
	} else
		_s->isUTF8 = true;
}

- (void)appendCharacters: (const of_unichar_t *)characters
		  length: (size_t)length
{
	char *tmp = of_malloc((length * 4) + 1, 1);

	@try {
		size_t j = 0;
		bool isUTF8 = false;

		for (size_t i = 0; i < length; i++) {
			size_t len = of_string_utf8_encode(characters[i],







|







371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
	} else
		_s->isUTF8 = true;
}

- (void)appendCharacters: (const of_unichar_t *)characters
		  length: (size_t)length
{
	char *tmp = of_alloc((length * 4) + 1, 1);

	@try {
		size_t j = 0;
		bool isUTF8 = false;

		for (size_t i = 0; i < length; i++) {
			size_t len = of_string_utf8_encode(characters[i],