ObjFW  Check-in [2140e81b53]

Overview
Comment:OFINIFile: Default to UTF-8
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 2140e81b53370e4b43c3513d39803cb652c8ce495b3ef97ad49476b2c3bced2b
User & Date: js on 2022-09-16 13:17:31
Other Links: manifest | tags
Context
2022-09-19
19:10
Fix missing void in function declarations check-in: 41c2b305ce user: js tags: trunk
2022-09-16
13:17
OFINIFile: Default to UTF-8 check-in: 2140e81b53 user: js tags: trunk
13:15
OFString: Improve exceptions check-in: 7dc3d12cad user: js tags: trunk
Changes

Modified src/OFINIFile.m from [8624252671] to [8c3437c559].

112
113
114
115
116
117
118



119
120
121
122
123
124
125

- (void)of_parseURL: (OFURL *)URL encoding: (OFStringEncoding)encoding
{
	void *pool = objc_autoreleasePoolPush();
	OFStream *file;
	OFINICategory *category = nil;
	OFString *line;




	@try {
		file = [OFURLHandler openItemAtURL: URL mode: @"r"];
	} @catch (OFOpenItemFailedException *e) {
		/* Handle missing file like an empty file */
		if (e.errNo == ENOENT)
			return;







>
>
>







112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128

- (void)of_parseURL: (OFURL *)URL encoding: (OFStringEncoding)encoding
{
	void *pool = objc_autoreleasePoolPush();
	OFStream *file;
	OFINICategory *category = nil;
	OFString *line;

	if (encoding == OFStringEncodingAutodetect)
		encoding = OFStringEncodingUTF8;

	@try {
		file = [OFURLHandler openItemAtURL: URL mode: @"r"];
	} @catch (OFOpenItemFailedException *e) {
		/* Handle missing file like an empty file */
		if (e.errNo == ENOENT)
			return;