Ticket #22 (checkedin defect)
Reporterkamil t. |
Opened: 12/22/08 Last modified: 07/3/09 Status: checkedin Type: defect Resolution: fixed |
Owner Adam Moore |
Target Release: unspecified Priority: P3 (normal) |
|---|---|---|---|
| Summary: | Non-english / accented characters anywhere in code are causing parser to break | ||
| Description: | Test case file attached. If I remove all accented characters then parser will create documentation without problems. If I leave them in any place then it breaks. <python traceback> Traceback (most recent call last): </python traceback> My configuration: Windows XP SP3, Python 2.5, all dependencies of YUIDoc installed with easy_install few days ago (so probably up to date). I can provide more details if necessary, also parser output, if attached file is not enough. |
||
| Type: | defect | Observed in Version: | 1.0.0b1 |
| Component: | YUIDoc | Severity: | S3 (normal) |
| Assigned To: | Adam Moore | Target Release: | unspecified |
| Location: | Example | Priority: | P3 (normal) |
| Tags: | Relates To: | ||
| Browsers: | N/A | ||
| URL: | |||
| Test Information: | |||
Change History
|
Posted: 01/15/09
|
|
Posted: 01/15/09
Hi, I downloaded the YUIDoc 1.0.0b1. My files are encoded in utf-8 and I have to use some Hungarian character and when I ran the yuidoc on it I got a similar error.
For me the following change helped:
I'm not so familiar with python, but I hope it will help. I'm using Debian Lenny. |
|
Posted: 02/19/09
|
|
Posted: 05/18/09
highlight handles high bit characters better. [fixes #22] |
|
Posted: 05/25/09
I find out that if source file contains chinese,the generated highlight file would have a wrong encoding。So i modified yuidoc_highlight.py (line 50) into the following: import codecs encoding is correct after modification。 |
|
Posted: 06/24/09
Fixed utf related highlighter crash [fixes #22] |
|
Posted: 07/2/09
Note: later versions of Cheetah (the template library yuidoc uses) is sometimes throwing an exception when it encounters international characters. If you encounter unicode errors, try downgrading to Cheetah 2.1.0. |
|
Posted: 07/3/09
The issue in the previous post has been addressed; it is not necessary to downgrade Cheetah. |
|
Posted: 08/11/09
Ticket #2173325 was marked as a duplicate of this ticket. |


Lajos Koszti
Changing *.js file encoding from utf-8 to something else could somethimes solve problem (depending on what kind of special characters we have in js file)
additional trackback - if we put in line 55 in yuidoc_highlight.py
highlighted = highlightString(fileStr)
print highlighted
we get this error:
Traceback (most recent call last):
File "c:yuidocbinyuidoc.py", line 104, in ?
main()
File "c:yuidocbinyuidoc.py", line 86, in main
opts.newext )
File "c:yuidocbinyuidoc_highlight.py", line 82, in __init__
highlightDir(os.path.abspath(i))
File "c:yuidocbinyuidoc_hi
ghlight.py", line 68, in highlightDir
highlightFile(path, i)
File "c:yuidocbinyuidoc_highlight.py", line 55, in highlightFile
print highlighted
File "C:Python24libencodingscp852.py", line 18, in encode
return codecs.charmap_encode(input,errors,encoding_map)
UnicodeEncodeError: 'charmap' codec can't encode characters in position 272-273:
character maps to <undefined>
(I guess that line 42-46 in yuidoc_highlight.py is NOT catching exception properly)
def highlightString(src):
try:
return highlight(src, JavascriptLexer(), HtmlFormatter())
except:
return "File could not be highlighted"
tested on winXP & python 2.4