Unknown encoding windows-31j




















Sign up for a free GitHub account to open an issue and contact its maintainers and the community. Already on GitHub? Sign in to your account. Encountered this problem with one game.

The text was updated successfully, but these errors were encountered:. Hmm, what OS are you running? And if you're running Windows, is your system codepage set to Japanese by chance? Sorry, something went wrong. Windows 10 bit and indeed language for non-Unicode programs is set to Japanese which is required to run Japanese games in many cases.

What was interesting with this encounter was that it came up with only one game from those i tested i can recheck with different locale if you want. No thanks, I think I've figured it out. I was a bit sloppy and assumed that Ruby would be using UTF-8 for string literals, but it seems it uses the encoding of the source file, which makes sense.

However, if you don't specify in the source file that it's encoded in UTF-8, it assumes the system codepage which in your case was CP which it can't concatenate with the strings that it read from the files which it explicitly encoded to UTF It worked for me because my codepage is UTF I have uninstalled both and installed again but still no success. The error means that Unicode characters that your script are trying to print can't be represented using the current console character encoding.

See How to set the path and environment variables in Windows article to get info how to add Windows variable. Also you can try to install win-unicode-console with pip:. However you can follow suggestions from Windows cmd encoding change causes Python crash answer because you have same problem.

Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Collectives on Stack Overflow.

Learn more. Python 2. Asked 5 years, 11 months ago. Active 1 year, 8 months ago. Viewed 76k times. Improve this question. Himanshu Bhandari Himanshu Bhandari 1, 1 1 gold badge 21 21 silver badges 34 34 bronze badges. You can probably reconfigure your terminal temporarily to use an encoding which is known to your Python version good old cp perhaps? This happened to me spontaneously in Powershell after enabling Japanese input and output on Windows Disabling it and restarting Powershell evidently resolved the issue.

You shouldn't get this error on Python 3. Add a comment. Active Oldest Votes. Improve this answer. Andriy Ivaneyko Andriy Ivaneyko It also fails with the same error. I am not able to use pip at all : — Himanshu Bhandari.



0コメント

  • 1000 / 1000