[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Best way to issue a warning in a C test

From: Stefan Sperling <stsp_at_elego.de>
Date: Mon, 14 Feb 2011 00:56:58 +0100

On Sun, Feb 13, 2011 at 11:15:13AM -0800, Danny Trebbien wrote:
> Per Philip's suggestion, I have switched the test to trying a list of
> locales. While I have not tested it on Windows, I am using examples
> from MSDN verbatim. It should work.
>
> I also try the Windows-specific locale strings first because I know
> that a Linux system successfully ignores them. Using the following,
> for example, the locale ends up being en_US.ISO-8859-1 on my Debian
> Linux "Squeeze" system supporting locales C, en_US, en_US.iso88591,
> en_US.utf8, eo, eo.iso88593, eo.utf8, and POSIX:
>
> if ((! setlocale(LC_ALL, "English.1252")) &&
> (! setlocale(LC_ALL, "German.1252")) &&
> (! setlocale(LC_ALL, "French.1252")) &&
> (! setlocale(LC_ALL, "en_US.ISO-8859-1")) &&
> (! setlocale(LC_ALL, "en_GB.ISO-8859-1")) &&
> (! setlocale(LC_ALL, "de_DE.ISO-8859-1")))
> return svn_error_createf(SVN_ERR_TEST_SKIPPED, NULL, "None of the
> locales English.1252, German.1252, French.1252, en_US.ISO-8859-1,
> en_GB.ISO-8859-1, and de_DE.ISO-8859-1 are installed.");

Fair enough.
But you will also need to try "en_US.ISO8859-1" (only one dash!)
for this work on OpenBSD, and possibly other BSDs.
Received on 2011-02-14 00:57:42 CET

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.