Dear all,
I have setup the python for eclipse but when run mysite test project, it prompt below errors. Please let me know how to fix it.
I have tried to set the encoding in each of files under the project but not OK and still show.
Fatal Python error: __Init__.py: can't initialize sys standard streams
LookupError: unknown encoding: MS950_HKSCS
So, google gave me this:
http://www.fileformat.info/info/charset/.../index.htm ,so I'm guessing at Sun Microsystems encoding, something to do with Java maybe?
Anyway you can set the encoding at the top of the file after the shebang line (windows doesn't use shebang, but it's a good idea to put one in anyway) see here
https://docs.python.org/3/reference/lexi...clarations though it does sound like something else is a miss really. If you are sure it is not your code, because it ran ok before, then I would look at how eclipse is set up. Without any more info it's tricky to second guess, but UTF8 is the standard encoding and for english, the other common on is ISO-8859-1, there is one more but I forget, most are one of these two, UTF8 being standard, so anything out of the ordinary to me implies something other than the code.
Nothing to do with Sun (which is just providing a Java class to handle this...). This is "Windows Traditional Chinese with Hong Kong extensions". Perhaps the OP's default encoding on Windows?
You can check your code page in a command terminal by typing "chcp"
Microsoft Windows [Version 10.0.14393]
(c) 2016 Microsoft Corporation. All rights reserved.
C:\>chcp
Active code page: 437
C:\>
You can change the code page in a similar fashion:
C:\>chcp 65001
Active code page: 65001
Note that this only changes the code page for the current session and the current terminal
Quote:windows doesn't use shebang
Actually, beginning with Python 3.3 or 3.4 (I forget which) Windows will honor the shebang line.