Opened 18 years ago
Closed 18 years ago
#815 closed defect (wontfix)
UnicodeDecodeError when creating PDF export
Reported by: | anonymous | Owned by: | Noah Kantrowitz |
---|---|---|---|
Priority: | normal | Component: | CombineWikiPlugin |
Severity: | blocker | Keywords: | |
Cc: | Trac Release: | 0.10 |
Description
Plugin activated by webadmin. I add few pages and click on create button :
Python Traceback Traceback (most recent call last): File "/usr/lib/python2.4/site-packages/trac/web/main.py", line 356, in dispatch_request dispatcher.dispatch(req) File "/usr/lib/python2.4/site-packages/trac/web/main.py", line 224, in dispatch resp = chosen_handler.process_request(req) File "/usr/lib/python2.4/site-packages/TracWebAdmin-0.1.2dev_r3772-py2.4.egg/webadmin/web_ui.py", line 109, in process_request path_info) File "build/bdist.linux-i686/egg/combinewiki/web_ui.py", line 60, in process_admin_request File "build/bdist.linux-i686/egg/combinewiki/web_ui.py", line 110, in _page_to_file UnicodeDecodeError: 'ascii' codec can't decode byte 0xe9 in position 34: ordinal not in range(128)
Attachments (0)
Change History (19)
comment:1 Changed 18 years ago by
comment:2 Changed 18 years ago by
I got the same error on a windows system.
What did you mean with "set your charset to something"?
comment:4 Changed 18 years ago by
I tried the following things: By default is was set to iso-8859-15. I tried tio change it to UTF-8 same result.
But this is only happening with some wiki-sides:
- All my own sides are not working (same error as above)
- Some wiki pages are working: e.g. TracIni
- Some not working: e.g. TracInstall (see error message below)
Traceback (most recent call last): File "D:\PROGRA~1\Python23\Lib\site-packages\trac\web\main.py", line 356, in dispatch_request dispatcher.dispatch(req) File "D:\PROGRA~1\Python23\Lib\site-packages\trac\web\main.py", line 224, in dispatch resp = chosen_handler.process_request(req) File "build\bdist.win32\egg\webadmin\web_ui.py", line 109, in process_request File "build\bdist.win32\egg\combinewiki\web_ui.py", line 60, in process_admin_request File "build\bdist.win32\egg\combinewiki\web_ui.py", line 107, in _page_to_file File "D:\PROGRA~1\Python23\Lib\encodings\iso8859_15.py", line 18, in encode return codecs.charmap_encode(input,errors,encoding_map) UnicodeEncodeError: 'charmap' codec can't encode character u'\u201c' in position 10962: character maps to <undefined>
Also the links to wiki pages are not correct in the PDF, there is missing the /wiki/ in the URL.
comment:5 Changed 18 years ago by
Hi, same error here with default sites (iso 8859-15, activated by WebAdmin or manually) with all wiki pages I have.
comment:6 Changed 18 years ago by
Greetings,
I've got the same error. Do you think that it could be realted to Trac ticket #3723 ?
comment:7 Changed 18 years ago by
More likely it is due to your version of HTMLDOC. I still need to merge over Alec's latest changes to PageToPdf
, which should fix this I think.
comment:8 Changed 18 years ago by
comment:11 Changed 18 years ago by
Hmm, thats the same version as me. I have default_charset = utf-8
, so maybe that will help?
comment:12 Changed 18 years ago by
Thank you for having closed #876 so fast, it works just fine.
But I still have the UnicodeDecodeError. My config is HTMLDoc 1.8.27 and I tryed default_charset as iso-8859-15 and utf-8 and the result is still the same.
comment:13 Changed 18 years ago by
Hmm, thats the same version as me. I have default_charset = utf-8, so maybe that will help?
Same error after changed settings.
comment:14 Changed 18 years ago by
Resolution: | → wontfix |
---|---|
Status: | new → closed |
Please see this comment.
comment:15 Changed 18 years ago by
Oups ! Sorry i have not the same error, I read too fast :
File "build/bdist.linux-i686/egg/combinewiki/web_ui.py", line 60, in process_admin_request File "build/bdist.linux-i686/egg/combinewiki/web_ui.py", line 110, in _page_to_file
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe9 in position 34: ordinal not in range(128)
It's not exactly same issue (Python 2.4, Trac 0.10, Ubuntu Dapper). Do I need create a new ticket ? (error occured after comment's change).
comment:16 Changed 18 years ago by
You cannot use characters that would require a multi-byte charset.
comment:17 Changed 18 years ago by
Resolution: | wontfix |
---|---|
Status: | closed → reopened |
I got this problem again:
UnicodeEncodeError: 'charmap' codec can't encode character u'\u201c' in position 13810: character maps to <undefined>
and I found a ticket for the PageToPDFPlugin, that seems to solve the problem: #1076
comment:18 Changed 18 years ago by
It's work for me with default_charset=utf-8 and iso in [pdftofile]. But isn't perfect. The Plugins translate with (in formats.py) :
page = wiki_to_html(text, self.env, req).encode(codepage)
It's not enough for a smooth translation : "événements" become "événements"
Maybe add a dictionnary like function to translate specific characters ?
comment:19 Changed 18 years ago by
Resolution: | → wontfix |
---|---|
Status: | reopened → closed |
As is stated many times, HTMLDOC does not support any multibyte character sets. You simply cannot use them with the PDF output format. The HTML output format does work with Unicode, so you can use that and then a local PDF virtual printer if you want.
Did you set your charset to something (probably you mean to use UTF8)?