0

So I get a japanese input through a tkinter Entry and I want to display it in the windows console as search term and then add it to a url from which I retrieve the sourecode with the requests module.

I solved parsing the link with

urllib.parse.quote("japanese part", encoding="utf-8")

but using

os.popen("chcp 65001")

doesn't work to print japanese to the console, I still get

UnicodeEncodeError: 'charmap' codec can't encode character

  • Have you read [this](http://stackoverflow.com/a/16347110/4041795) answer and the corresponding question? Seems the same? Also check the other answers to that question, as there are multiple approaches. – Montmons Apr 02 '17 at 11:34
  • Also, you could try adding a shebang like so `# -*- coding: utf-8 -*-` at the top of your python script. – Montmons Apr 02 '17 at 11:37
  • Sorry, I forgot to mention that. Due to german comments for myself I always use `# -*- coding: utf-8 -*-` And yes I tried what they wrote in that answer, but nothing changed sadly. – EinAeffchen Apr 02 '17 at 15:35

0 Answers0