jorgebastida/glue — pull request #65 by bf (2012-11-07 12:50:49+00:00)
Title: Fixed UnicodeError when using --global-template with UTF8 text

Further changes:
- write CSS in an UTF-8 encoded file by using the "codecs" import
- show traceback of "Unknown Errors" when in debug mode

Description:
I encountered weird UnicodeEncode errors when using glue on command line on *nix systems. After enabling error tracebacks, I found out that handling of user specified global CSS templates containing UTF8 characters lacked a proper UTF8 decoding. Decoding was in place, but only using "unicode-escape".

I have now fixed this issue by decoding user input by using the codec specified by ``sys.getfilesystemencoding()`` and by writing the output CSS file encoded as UTF8.

There might be some problems with this implementation as it is not tested on Windows machines, but this change fixed the issue I have been experiencing.