Supports locale-specified encoding for rcfile.

This commit fixes issue #1317.  The locale for the encoding is obtained from
the Python `locale` module, which can be specified by the `LANG` environment
variable.

This was tested by adding a test rc file encoded in UTF-32-BE, and testing that
it decoded correctly.
Luckily, the encodings come from python's standard library not from the OS. UTF-32-BE has been available in at least Python 2.7 and newer. What're the oldest Pythons that matplotlib supports? I couldn't find this from a cursory glance at the matplotlib documentation.