Fix for when  `locale.getpreferredencoding(do_setlocale=True)` returns an empty string

I'm not sure why, but this plugin stopped working for me a few weeks ago. I finally got around to debugging the issue and the problem was that there was a 'unknown encoding' exception being thrown because `locale.getpreferredencoding(do_setlocale=True)` returned an empty string (note, it returned `US-ASCII` when `do_setlocale` was set to `False`.