Should use wide-string function instead of SetConsoleOutputCP. Fixes #1121
This addresses #1136, and mitigates a stack exhaustion when printing a very deeply nested term.