ObjFW  Diff

Differences From Artifact [fd0de86dc5]:

To Artifact [2ba568e7fc]:


25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#import "OFString.h"
#import "OFAutoreleasePool.h"
#import "OFExceptions.h"
#import "OFMacros.h"

#import "asprintf.h"

#import "encodings/iso_8859_15.h"
#import "encodings/windows_1252.h"

/* References for static linking */
void _references_to_categories_of_OFString()
{
	_OFHashing_reference = 1;
	_OFURLEncoding_reference = 1;
	_OFXMLElement_reference = 1;







|
|







25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#import "OFString.h"
#import "OFAutoreleasePool.h"
#import "OFExceptions.h"
#import "OFMacros.h"

#import "asprintf.h"

extern const uint16_t of_iso_8859_15[256];
extern const uint16_t of_windows_1252[256];

/* References for static linking */
void _references_to_categories_of_OFString()
{
	_OFHashing_reference = 1;
	_OFURLEncoding_reference = 1;
	_OFXMLElement_reference = 1;
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
				size_t chr_bytes;

				switch (encoding) {
				case OF_STRING_ENCODING_ISO_8859_1:
					chr = (uint8_t)str[i];
					break;
				case OF_STRING_ENCODING_ISO_8859_15:
					chr = iso_8859_15_to_unicode[
					    (uint8_t)str[i]];
					break;
				case OF_STRING_ENCODING_WINDOWS_1252:
					chr = windows_1252_to_unicode[
					    (uint8_t)str[i]];
					break;
				default:
					/*
					 * We can't use [super dealloc] on OS X
					 * here. Compiler bug? Anyway,
					 * [self dealloc] will do here as we
					 * don't reimplement dealloc.







<
|


<
|







335
336
337
338
339
340
341

342
343
344

345
346
347
348
349
350
351
352
				size_t chr_bytes;

				switch (encoding) {
				case OF_STRING_ENCODING_ISO_8859_1:
					chr = (uint8_t)str[i];
					break;
				case OF_STRING_ENCODING_ISO_8859_15:

					chr = of_iso_8859_15[(uint8_t)str[i]];
					break;
				case OF_STRING_ENCODING_WINDOWS_1252:

					chr = of_windows_1252[(uint8_t)str[i]];
					break;
				default:
					/*
					 * We can't use [super dealloc] on OS X
					 * here. Compiler bug? Anyway,
					 * [self dealloc] will do here as we
					 * don't reimplement dealloc.