ObjFW  Check-in [8e8bb78eb5]

Overview
Comment:Correctly set isUTF8 in -[OFString initWithUnicodeString:].
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 8e8bb78eb58a1beed4b91413386c92722d29ac57094602c54f941138ca973fa6
User & Date: js on 2011-05-01 12:43:18
Other Links: manifest | tags
Context
2011-05-01
14:24
Move structs and enums only needed internally to .m files. check-in: 69ebd2ccbf user: js tags: trunk
12:43
Correctly set isUTF8 in -[OFString initWithUnicodeString:]. check-in: 8e8bb78eb5 user: js tags: trunk
00:35
Add +[OFString stringWithUnicodeString:]. check-in: e2bbfb45d0 user: js tags: trunk
Changes

Modified src/OFString.m from [b307aaa0bd] to [04afab8da6].

572
573
574
575
576
577
578


579
580
581
582
583
584
585
586
587


588
589
590
591
592
593
594
595
596


597
598
599
600
601
602
603
				    *string_, buffer);

			switch (characterLen) {
			case 1:
				string[i++] = buffer[0];
				break;
			case 2:


				length++;
				string = [self resizeMemory: string
						     toSize: length + 1];

				memcpy(string + i, buffer, 2);
				i += 2;

				break;
			case 3:


				length += 2;
				string = [self resizeMemory: string
						     toSize: length + 1];

				memcpy(string + i, buffer, 3);
				i += 3;

				break;
			case 4:


				length += 3;
				string = [self resizeMemory: string
						     toSize: length + 1];

				memcpy(string + i, buffer, 4);
				i += 4;








>
>









>
>









>
>







572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
				    *string_, buffer);

			switch (characterLen) {
			case 1:
				string[i++] = buffer[0];
				break;
			case 2:
				isUTF8 = YES;

				length++;
				string = [self resizeMemory: string
						     toSize: length + 1];

				memcpy(string + i, buffer, 2);
				i += 2;

				break;
			case 3:
				isUTF8 = YES;

				length += 2;
				string = [self resizeMemory: string
						     toSize: length + 1];

				memcpy(string + i, buffer, 3);
				i += 3;

				break;
			case 4:
				isUTF8 = YES;

				length += 3;
				string = [self resizeMemory: string
						     toSize: length + 1];

				memcpy(string + i, buffer, 4);
				i += 4;