Python Forum
unknown encoding: MS950_HKSCS
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
unknown encoding: MS950_HKSCS
#1
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
Reply
#2
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.
Reply
#3
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?
Unless noted otherwise, code in my posts should be understood as "coding suggestions", and its use may require more neurones than the two necessary for Ctrl-C/Ctrl-V.
Your one-stop place for all your GIMP needs: gimp-forum.net
Reply
#4
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.
If it ain't broke, I just haven't gotten to it yet.
OS: Windows 10, openSuse 42.3, freeBSD 11, Raspian "Stretch"
Python 3.6.5, IDE: PyCharm 2018 Community Edition
Reply
#5
Here's a little more info http://hkdevtips.blogspot.com/2012/03/ja...hkscs.html
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020