[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: Danny Trebbien <dtrebbien_at_gmail.com>
Date: Sat, 12 Feb 2011 17:18:46 -0800

> How about trying a list?  en_US.8859-1 is widely available even if not
> actually installed.  I don't know which non-utf8 locales are widely
> installed, personally I have en_GB.8859-1.  We have several German devs
> so maybe de_DE.8859-1?  Perhaps jp_JP.EUC-JP?

While I couldn't get SVN_TEST_SKIP2 to work because the availability
of a locale cannot be tested at preprocessing time, I found out that
returning an SVN_ERR_TEST_SKIPPED error has the same effect.

I like your idea of trying a list. Here is what I ended up with:

    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.");
Received on 2011-02-13 02:19:28 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.