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'))

 JSGantt 1.0 Launched on google code

    Posted At : October 1, 2008 10:19 AM

JSGantt has officially launched on google code:

http://code.google.com/p/jsgantt/

A few developers are already working on wrappers for PHP, .NET, JSP and ColdFusion. Bleeding edge builds will be available via SVN.

You can also download the current version via the main site at http://www.jsgantt.com

Powered by BlogCFC

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

Aggregated by fullasagoog.com
[Valid RSS]

Add to Google