{"action":"created","issue":{"url":"https://api.github.com/repos/SublimeTextIssues/Core/issues/926","labels_url":"https://api.github.com/repos/SublimeTextIssues/Core/issues/926/labels{/name}","comments_url":"https://api.github.com/repos/SublimeTextIssues/Core/issues/926/comments","events_url":"https://api.github.com/repos/SublimeTextIssues/Core/issues/926/events","html_url":"https://github.com/SublimeTextIssues/Core/issues/926","id":94322314,"number":926,"title":"print(u\"\\uFFFD\") fails with a UnicodeEncodeError","user":{"login":"Tobger","id":10852535,"avatar_url":"https://avatars.githubusercontent.com/u/10852535?v=3","gravatar_id":"","url":"https://api.github.com/users/Tobger","html_url":"https://github.com/Tobger","followers_url":"https://api.github.com/users/Tobger/followers","following_url":"https://api.github.com/users/Tobger/following{/other_user}","gists_url":"https://api.github.com/users/Tobger/gists{/gist_id}","starred_url":"https://api.github.com/users/Tobger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Tobger/subscriptions","organizations_url":"https://api.github.com/users/Tobger/orgs","repos_url":"https://api.github.com/users/Tobger/repos","events_url":"https://api.github.com/users/Tobger/events{/privacy}","received_events_url":"https://api.github.com/users/Tobger/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/SublimeTextIssues/Core/labels/C:%20Build%20Systems","name":"C: Build Systems","color":"669933"},{"url":"https://api.github.com/repos/SublimeTextIssues/Core/labels/C:%20OS%20Integration","name":"C: OS Integration","color":"669933"},{"url":"https://api.github.com/repos/SublimeTextIssues/Core/labels/S:%20minor","name":"S: minor","color":"F2A984"},{"url":"https://api.github.com/repos/SublimeTextIssues/Core/labels/T:%20bug","name":"T: bug","color":"e11d21"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":10,"created_at":"2015-07-10T14:52:46Z","updated_at":"2015-08-21T18:55:00Z","closed_at":null,"body":"**How to reproduce**:\r\n0. Install python\r\n1. Create file `test.py` with content `print(u\"\\uFFFD\")`\r\n2. Open with Sublime and run code\r\n\r\n**Expected output**\r\n`�`\r\n(replacement character used to replace an unknown or unrepresentable character, a white question mark on a black diamond)\r\n\r\n**Actual output**\r\n\r\n\tTraceback (most recent call last):\r\n\t  File \"C:\\Users\\tr\\Desktop\\test.py\", line 1, in <module>\r\n\t    print(u\"\\uFFFD\")\r\n\t  File \"C:\\Python34\\lib\\encodings\\cp1252.py\", line 19, in encode\r\n\t    return codecs.charmap_encode(input,self.errors,encoding_table)[0]\r\n\tUnicodeEncodeError: 'charmap' codec can't encode character '\\ufffd' in position 0: character maps to <undefined>\r\n\t[Finished in 0.1s with exit code 1]\r\n\r\n**Other notes**\r\nThis in not an issue about python and unicode. The code works fine in IDLE. There is a [comment on stackoverflow](http://stackoverflow.com/questions/31341423/make-sublime-2-print-unicode-characters-with-python) that the issue persists in SL3 beta on MacOS.\r\nThe windows console `cmd` also has this issue, so it may have to do with piping the output from python to the console correctly (-u option?). My first guess would be checking how the piping differs between IDLE and sublime.\r\nThe [suggestions](https://github.com/SublimeTextIssues/Core/issues/884#issuecomment-112947817) to the related issue #884 did not fix the issue, but maybe I just didn't use the right combination.\r\n\r\n**System**\r\nSublime Text 2 Version 2.0.2, Build 2221\r\npython 3.4.1\r\nWindows 7\r\n(and a hearsay of SL3beta on MacOS)"},"comment":{"url":"https://api.github.com/repos/SublimeTextIssues/Core/issues/comments/133529944","html_url":"https://github.com/SublimeTextIssues/Core/issues/926#issuecomment-133529944","issue_url":"https://api.github.com/repos/SublimeTextIssues/Core/issues/926","id":133529944,"user":{"login":"vovkkk","id":1975298,"avatar_url":"https://avatars.githubusercontent.com/u/1975298?v=3","gravatar_id":"","url":"https://api.github.com/users/vovkkk","html_url":"https://github.com/vovkkk","followers_url":"https://api.github.com/users/vovkkk/followers","following_url":"https://api.github.com/users/vovkkk/following{/other_user}","gists_url":"https://api.github.com/users/vovkkk/gists{/gist_id}","starred_url":"https://api.github.com/users/vovkkk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vovkkk/subscriptions","organizations_url":"https://api.github.com/users/vovkkk/orgs","repos_url":"https://api.github.com/users/vovkkk/repos","events_url":"https://api.github.com/users/vovkkk/events{/privacy}","received_events_url":"https://api.github.com/users/vovkkk/received_events","type":"User","site_admin":false},"created_at":"2015-08-21T18:55:00Z","updated_at":"2015-08-21T18:55:00Z","body":"http://stackoverflow.com/questions/16748083/suppress-print-without-b-prefix-for-bytes-in-python-3\r\n\r\n```python\r\nsys.stdout.buffer.write(u\"\\u00CB\".encode('utf8') + b'\\n')\r\n```\r\n\r\n![2015-08-22 00-50-41 c users vova desktop b py - sublime text 2](https://cloud.githubusercontent.com/assets/1975298/9416569/2c836800-4868-11e5-8595-3477a84afb8b.png)\r\n\r\nGuys, am I stupid or Python devs are insane? I mean, it’s just… what the f…"}}