kgashok / amphetype

Automatically exported from code.google.com/p/amphetype
1 stars 0 forks source link

Replacement of "fancy" characters in input text #21

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I discovered that some "fancy" characters will be imported from .txt files, but 
that we are unable to type them in the actual lesson.

What steps will reproduce the problem?
1. Import a text file with one or more of these characters: “ ” ’ …
2. Attempt a lesson with them.

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

We cannot type those characters to complete the lesson.

What version of the product are you using? On what operating system?

Ubuntu Linux, directly from source via svn checkout, using Python 2.6.5

Please provide any additional information below.

The following patch on Text.py fixes it for me:

14,17d13
< #some undesired fancy characters to replace
< fancy2normal = [(u"“",u'"'),(u"”",u'"'),(u"’",u"'"),(u"…",u"...")]
<            
< 
108,111d103
<             #replaces some undesired fancy characters
<             for fancy, normal in fancy2normal:
<                 l = l.replace(fancy, normal)
<                 

Other replacements can be added to the fancy2normal list.

Original issue reported on code.google.com by lalop.ll...@gmail.com on 11 May 2013 at 3:14