Python Forum
how do i get utf-8 encoding for real?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how do i get utf-8 encoding for real?
#1
i am running into these errors and wondering how i change the encoding to really get utf-8.
Output:
lt1/pdh /home/pdh 46> py2 new-sessionin.py foo -141 ... local var: 'c' = '1' ... local var: 'n' = 141 ... local var: 'data' = ['\x8d'] Traceback (most recent call last):   File "new-sessionin.py", line 476, in <module>     result=main(sys.argv)   File "new-sessionin.py", line 439, in main     rr = decode_control( s[1:] )   File "new-sessionin.py", line 330, in decode_control     istr = [chr(x) for x in bytearray(istr,encoding='utf8')] UnicodeDecodeError: 'ascii' codec can't decode byte 0x8d in position 0: ordinal not in range(128) lt1/pdh /home/pdh 47> py3 new-sessionin.py foo -141 ... local var: 'c' = '1' ... local var: 'n' = 141 ... local var: 'data' = ['\x8d'] ... local var: 'rr' = (0, '\xc2\x8d') Traceback (most recent call last):   File "new-sessionin.py", line 476, in <module>     result=main(sys.argv)   File "new-sessionin.py", line 467, in main     r = execvp(c[0],c)   File "/usr/local/bin/../../lib/python3.5/os.py", line 615, in execvp     _execvpe(file, args)   File "/usr/local/bin/../../lib/python3.5/os.py", line 650, in _execvpe     exec_func(fullname, *argrest) UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-1: ordinal not in range(128) lt1/pdh /home/pdh 48>
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply


Messages In This Thread
how do i get utf-8 encoding for real? - by Skaperen - Dec-03-2017, 05:33 AM

Forum Jump:

User Panel Messages

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