1000goalsoffice / support-tools

Automatically exported from code.google.com/p/support-tools
Apache License 2.0
0 stars 0 forks source link

UnicodeEncodeError: 'ascii' codec can't encode character #19

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. run wiki2gfm.py with wiki input from 
https://code.google.com/p/fusioncatcher/wiki/Manual 

What is the expected output? What do you see instead?

It is expected to end without error. The following error is shown:

Warning (line 1 of input file):
A summary pragma was used for this wiki:
    Manual
Consider moving it to an introductory paragraph.

Warning (line 3 of input file):
A table of contents plugin was used for this wiki:
    <wiki:toc max_depth="2" />
The Gollum wiki system supports table of content generation.
See https://github.com/gollum/gollum/wiki for more information.
It has been removed.

Traceback (most recent call last):
  File "/apps/bin/support-tools/wiki_to_md/wiki2gfm.py", line 122, in <module>
    main(sys.argv)
  File "/apps/bin/support-tools/wiki_to_md/wiki2gfm.py", line 118, in main
    converter.Convert(input_stream, output_stream)
  File "/apps/bin/support-tools/wiki_to_md/impl/converter.py", line 123, in Convert
    input_line = self._ProcessBody(input_line, input_lines, output_stream)
  File "/apps/bin/support-tools/wiki_to_md/impl/converter.py", line 215, in _ProcessBody
    output_stream)
  File "/apps/bin/support-tools/wiki_to_md/impl/converter.py", line 346, in _ProcessLine
    output_stream)
  File "/apps/bin/support-tools/wiki_to_md/impl/converter.py", line 513, in _ProcessMatch
    handler(input_line, match, output_stream)
  File "/apps/bin/support-tools/wiki_to_md/impl/converter.py", line 604, in _HandleBold
    self._HandleTag(input_line, "Bold", output_stream)
  File "/apps/bin/support-tools/wiki_to_md/impl/converter.py", line 1281, in _HandleTag
    self._CloseTag(input_line, tag, output_stream)
  File "/apps/bin/support-tools/wiki_to_md/impl/converter.py", line 433, in _CloseTag
    handler(input_line, output_stream)
  File "/apps/bin/support-tools/wiki_to_md/impl/formatting_handler.py", line 297, in HandleBoldClose
    self._HandleFormatClose(input_line, output_stream, "Bold")
  File "/apps/bin/support-tools/wiki_to_md/impl/formatting_handler.py", line 960, in _HandleFormatClose
    self._Write("{0}{1}{0}".format(tag, format_buffer), output_stream)
UnicodeEncodeError: 'ascii' codec can't encode character u'\u2013' in position 
54: ordinal not in range(128)

Original issue reported on code.google.com by daniel.n...@gmail.com on 13 Mar 2015 at 9:30

GoogleCodeExporter commented 9 years ago
Let me take a look, I think I fixed a case when addressing this class of issue 
elsewhere...

Original comment by chrsm...@google.com on 13 Mar 2015 at 9:34

GoogleCodeExporter commented 9 years ago
Nick Gorski, Python expert, has fixed this issue. Please reactivate if you 
still encounter problems

r937ced33b1eb4e7dba8265eeb76f1da7fc0448d1

Original comment by chrsm...@google.com on 13 Mar 2015 at 8:49