ObjFW  Diff

Differences From Artifact [be2a2ed79d]:

To Artifact [5bd62589b9]:


80
81
82
83
84
85
86
87
88
89
90

91
92
93
94
95
96
97
98
99
100
101
80
81
82
83
84
85
86




87




88
89
90
91
92
93
94







-
-
-
-
+
-
-
-
-







	size_t i, last;
	BOOL in_entity;
	OFMutableString *ret;

	last = 0;
	in_entity = NO;
	ret = [OFMutableString string];

	switch (of_string_check_utf8(string, length)) {
	case 1:
		((OFString*)ret)->isUTF8 = YES;
	((OFString*)ret)->isUTF8 = [self isUTF8];
		break;
	case -1:
		@throw [OFInvalidEncodingException newWithClass: isa];
	}

	for (i = 0; i < length; i++) {
		if (!in_entity && string[i] == '&') {
			[ret appendCStringWithoutUTF8Checking: string + last
						       length: i - last];

			last = i + 1;