UnicodeEncodeError: 'utf-8' codec can't encode character '\udcc3' in position 19: surrogates not allowed
Bug #1498366 reported by
Nils Fredrik Gjerull
This bug affects 6 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
HPLIP |
Fix Committed
|
Undecided
|
Gaurav Sood | ||
hplip (Debian) |
Fix Released
|
Unknown
|
Bug Description
I use version 3.15.2-0ubuntu4.2 of hplip.
The attached document causes the UnicodeEncodeError in the /usr/lib/
It look like the document contains some surrogate escapes. I solved the problem by altering the file "/usr/share/
I changed "return s.encode("utf-8")" on line 109 with "return s.encode("utf-8", errors=
tags: | added: surrogate unicode |
Changed in hplip: | |
assignee: | nobody → Gaurav Sood (gaurav-sood) |
Changed in hplip (Debian): | |
status: | Unknown → New |
Changed in hplip: | |
status: | New → In Progress |
Changed in hplip: | |
status: | In Progress → Fix Committed |
Changed in hplip (Debian): | |
status: | New → Confirmed |
Changed in hplip (Debian): | |
status: | Confirmed → Fix Released |
To post a comment you must log in.
I can confirm this bus on Arch Linux as well.
Name : hplip
Version : 3.15.11-1
~~~ 2015:20: 08:30 +0100] [Job 126] Started filter /usr/lib/ cups/filter/ pdftopdf (PID 27890) 2015:20: 08:30 +0100] [Job 126] Started filter /usr/lib/ cups/filter/ pdftops (PID 27891) 2015:20: 08:30 +0100] [Job 126] Started filter /usr/lib/ cups/filter/ hpps (PID 27892) 2015:20: 08:30 +0100] [Job 126] Started backend /usr/lib/ cups/backend/ hp (PID 27893) 2015:20: 08:30 +0100] [Job 126] pdftops - copying to temp print file "/var/spool/ cups/tmp/ 06cf3565f04e8" 2015:20: 08:30 +0100] [Job 126] Printer make and model: HP HP Color LaserJet Pro M252c10 2015:20: 08:30 +0100] [Job 126] Running command line for pstops: pstops 126 d 'asdf' 1 'HPRGBEmulation =Adobe HPGenera 2015:20: 08:30 +0100] [Job 126] Using image rendering resolution 600 dpi 2015:20: 08:30 +0100] [Job 126] Running command line for gs: gs -q -dNOPAUSE -dBATCH -dSAFER -sDEVICE=ps2write -sOUTPUTFILE= %stdout -dLanguag 2015:20: 08:30 +0100] [Job 126] Started filter gs (PID 27895) 2015:20: 08:30 +0100] [Job 126] Started filter pstops (PID 27896) 2015:20: 08:30 +0100] [Job 126] PID 27890 (/usr/lib/ cups/filter/ pdftopdf) exited with no errors. 2015:20: 08:30 +0100] [Job 126] STATE: +connecting- to-device 2015:20: 08:30 +0100] [Job 126] Traceback (most recent call last): 2015:20: 08:30 +0100] [Job 126] File "/usr/lib/ cups/filter/ hpps", line 186, in <module> 2015:20: 08:30 +0100] [Job 126] os.write(output_fd, to_bytes_utf8('@PJL SET JOBNAME="%s"\x0a' % title)) 2015:20: 08:30 +0100] [Job 126] File "/usr/share/ hplip/base/ sixext. py", line 109, in to_bytes_utf8 2015:20: 08:30 +0100] [Job 126] return s.encode("utf-8") 2015:20: 08:30 +0100] [Job 126] UnicodeEncodeError: 'utf-8' codec can't encode character '\udcc3' in position 31: surrogates not allowed 2015:20: 08:30 +0100] [Job 126] PID 27892 (/usr/lib/ cups/filter/ hpps) stopped with status 1. 2015:20: 08:30 +0100] [Job 126] Hint: Try setting the LogLevel to "debug" to find out more.
D [28/Nov/
D [28/Nov/
D [28/Nov/
D [28/Nov/
D [28/Nov/
D [28/Nov/
D [28/Nov/
D [28/Nov/
D [28/Nov/
D [28/Nov/
D [28/Nov/
D [28/Nov/
D [28/Nov/
D [28/Nov/
D [28/Nov/
D [28/Nov/
D [28/Nov/
D [28/Nov/
D [28/Nov/
D [28/Nov/
D [28/Nov/
D
~~~