ros-infrastructure / rosdoc_lite

A light-weight version of rosdoc that does not rely on ROS infrastructure for crawling packages.
10 stars 31 forks source link

Fails with utf8 characters #5

Closed stephanemagnenat closed 11 years ago

stephanemagnenat commented 11 years ago

Running rosdoc_lite on the aseba package in the ethzasl_aseba stack (https://github.com/ethz-asl/ros-aseba/tree/master/aseba) fails, most probably because my first name has an acute accent in manifest.xml.

The error is the following:

smagnenat@bvy:/home/smagnenat_local/build/groovy/ethzasl_aseba/aseba$ rosdoc_lite .
Documenting a non-catkin package
Documenting aseba located here: /home/smagnenat_local/build/groovy/ethzasl_aseba/aseba
{'doxygen': {'builder': 'doxygen', 'output_dir': '.'}}
{'builder': 'doxygen', 'output_dir': '.'}
Generated the following tagfile string 
ERROR: Doxygen of package [aseba] failed: 'ascii' codec can't encode character u'\xe9' in position 2: ordinal not in range(128)
Traceback (most recent call last):
  File "/opt/ros/groovy/lib/python2.7/dist-packages/rosdoc_lite/__init__.py", line 173, in generate_docs
    plugin(path, package, manifest, build_params[plugin_name], html_dir, quiet)
  File "/opt/ros/groovy/lib/python2.7/dist-packages/rosdoc_lite/doxygenator.py", line 211, in generate_doxygen
    header, footer, manifest_html = [rdcore.instantiate_template(t, manifest_vars) for t in [header_template, footer_template, manifest_template]]
  File "/opt/ros/groovy/lib/python2.7/dist-packages/rosdoc_lite/rdcore.py", line 143, in instantiate_template
    tmpl = tmpl.replace(k, str(v).encode('utf-8'))
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in position 2: ordinal not in range(128)
plugin [doxygen] failed
eitanme commented 11 years ago

Sorry that it took me so long to get around to this. Unicode conversion is a bit of a pain in certain situations. If you're interested, http://packages.python.org/kitchen/unicode-frustrations.html, is kind of a fun read. In the end, things should be fixed in the next release.

groovy: 0dbb99ed5c1f3e6af7477bdf4cf3a9ed5818725b fuerte: 16e3fd77d973df432172c7e0b71d6cfb245426f2

stephanemagnenat commented 11 years ago

Thank you very much, yes encoding is always frustrating.