tests: Improve test for supported encodings.
I misunderstood the purpose for the config.charset script. I had a
notion that it was supposed to print all of the character sets that
are supported by the operating system. It doesn't (it prints
character set names that need translation for the operating system).
This change switches to using the same code that will be used at
PSPP runtime to determine whether an encoding is supported, for
determining during the tests whether an encoding is supported.
This should cause fewer tests to be skipped on Mac OS.
Reported-by: Jeremy Lavergne <jeremy@lavergne.gotdns.org>