overviewer/Minecraft-Overviewer — pull request #960 by fuzzyray (2013-07-19 17:18:10+00:00)
Title: Fix LookupError for unknown encodings.

Sets the preferred encoding to UTF-8 if python is unable to find a codec
for the value returned by locale.getpreferedencodings() function.

Without this fix, the following traceback occurs when python doesn't know the encoding:

2013-07-19 11:41:26 E An error has occurred. This may be a bug. Please let us know!
See http://docs.overviewer.org/en/latest/index.html#help

This is the error that occurred:
Traceback (most recent call last):
File "./overviewer.py", line 532, in
ret = main()
File "./overviewer.py", line 473, in main
assetMrg.initialize(tilesets)
File "/Users/pvarner/Minecraft-Overviewer/overviewer_core/assetmanager.py", line 72, in initialize
self._output_assets(tilesets, True)
File "/Users/pvarner/Minecraft-Overviewer/overviewer_core/assetmanager.py", line 146, in _output_assets
self.output_noconfig()
File "/Users/pvarner/Minecraft-Overviewer/overviewer_core/assetmanager.py", line 188, in output_noconfig
index = index.replace("{time}", time.strftime("%a, %d %b %Y %H:%M:%S %Z", time.localtime()).decode(locale.getpreferredencoding()))
LookupError: unknown encoding: