ObjFW  Check-in [8a459e4b5d]

Overview
Comment:OFLocale: Default to codepage 437 on MS-DOS

If we cannot parse the codepage (e.g. because we don't support it), it's
better to fall back to codepage 437 than to UTF-8.

Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 8a459e4b5d3edc0c4da669a7a9be1b2cdb8d4cd2da917f96731aaf5e0957b1b4
User & Date: js on 2022-12-05 00:50:48
Other Links: manifest | tags
Context
2022-12-10
16:03
OFSystemInfo: Report DOS flavor and version check-in: 7c3ccb6b50 user: js tags: trunk
2022-12-05
00:50
OFLocale: Default to codepage 437 on MS-DOS check-in: 8a459e4b5d user: js tags: trunk
2022-12-04
23:23
OFINIFileTests: Handle nil temporaryDirectoryIRI check-in: 07a3215739 user: js tags: trunk
Changes

Modified src/OFLocale.m from [962451e814] to [efa00a7a3e].

375
376
377
378
379
380
381



382

383
384
385
386
387
388
389
#ifndef OF_AMIGAOS
		char *locale, *messagesLocale = NULL;

		if (currentLocale != nil)
			@throw [OFInitializationFailedException
			    exceptionWithClass: self.class];




		_encoding = OFStringEncodingUTF8;

		_decimalSeparator = @".";
		_localizedStrings = [[OFMutableArray alloc] init];

		if ((locale = setlocale(LC_ALL, "")) != NULL)
			_decimalSeparator = [[OFString alloc]
			    initWithCString: localeconv()->decimal_point
				   encoding: _encoding];







>
>
>

>







375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
#ifndef OF_AMIGAOS
		char *locale, *messagesLocale = NULL;

		if (currentLocale != nil)
			@throw [OFInitializationFailedException
			    exceptionWithClass: self.class];

# ifdef OF_MSDOS
		_encoding = OFStringEncodingCodepage437;
# else
		_encoding = OFStringEncodingUTF8;
# endif
		_decimalSeparator = @".";
		_localizedStrings = [[OFMutableArray alloc] init];

		if ((locale = setlocale(LC_ALL, "")) != NULL)
			_decimalSeparator = [[OFString alloc]
			    initWithCString: localeconv()->decimal_point
				   encoding: _encoding];