Solving UTF-8 issue with YUI Doc

    Posted At : May 16, 2009 2:53 PM

I recently encountered an error when trying to parse a javascript document with YUI DOC. YUI Doc is a Python application used at build time to generate API documentation for JavaScript code. The javascript file had a few non-standard characters that were causing YUI Doc to crash with the following error:

Traceback (most recent call last):
  File "C:\yuidoc\bin\yuidoc.py", line 104, in?    main()
  File "C:\yuidoc\bin\yuidoc.py", line 86, in main    opts.newext )
  File "C:\yuidoc\bin\yuidoc_highlight.py", line 82, in __init__    highlightDir(os.path.abspath(i))
  File "C:\yuidoc\bin\yuidoc_highlight.py", line 68, in highlightDir    highlightFile(path, i)
  File "C:\yuidoc\bin\yuidoc_highlight.py", line 57, in highlightFile    out.writelines(highlighted)
TypeError: writelines() argument must be a sequence of strings

The fix was rather simple. Edit yuidoc_highlight.py

change line 57

out.writelines(highlighted)
to
out.writelines(highlighted.encode('utf-8'))

Comments
vinayak's Gravatar hi ,
I saw jsgantt . it is good. i wanted to add drag and drop feature to
it using jquery. did you try drag ans drop on jsgantt?
does it have print option ?
Thanks
vinayak
# Posted By vinayak | 12/20/09 12:53 PM
none's Gravatar It works perfectly, Cheers ^^
# Posted By none | 2/16/10 11:19 AM
Powered by BlogCFC

HostMySite.com Web Hosting Provided by www.HostMySite.com

Aggregated by fullasagoog.com
[Valid RSS]

Add to Google