I am working on a large command line tool, written for Python 2.6+ and supported for Windows, OS X and Linux. The target users are developers but it is also being auto-invoked by CI-systems etc. In the Windows environment, our tool runs in cmd.exe, but in the other OS's we allow whatever terminal the users have.
I would really like to add general unicode support to this tool, in particular to print non-ascii characters to the terminal. Python is in general pretty nice with unicode, but cmd.exe does not play well with my small tests due to some issue with the encoding. I can probably "get it to work" on Windows in some way, but can other encoding issues occur in other terminals? Do "most modern terminals" use utf-8 on GNU/Linux and OS X (or is it locale dependent?). Also, if an encoding mismatch occurs, will "most terminals" just output garbled chars, or will they actually crash? Is it in general possible to reliably determine the encoding used by the terminal?
Looking mainly for people who have attempted at implementing cross platform command line tools with unicode support. My goal with this question is to determine whether I can implement unicode support with little to moderate effort which works for the vast majority of our users.