Using the python unicode function -


i'm working on project compares text.

here relevant piece of code:

def post(self):     = unicode(flask.request.form['a'])     b = unicode(flask.request.form['b']) 

i posted large pieces of text project gutenberg , errors this:

unicodeencodeerror: 'ascii' codec can't encode character u'\xe9' in position 6: ordinal not in range(128)

based on this page have tried errors ignore , errors replace , error:

typeerror: decoding unicode not supported

if possible want able take in robust set of characters possible. hoping there python library allow this.

here more of code. think problem may occur when try turn input string.

    c = a.split()     d = b.split()     both = []     x in c:         if x in d:             both.append(x)     x in range(len(both)):         both[x]=str(both[x])     final = []     x in set(both):         final.append(x)     missinga = []     x in c:         if x not in final , x not in missinga:             missinga.append(x)     x in range(len(missinga)):         missinga[x]=str(missinga[x])     missingb = [] 

here more of code. think problem may occur when try turn input string.

i think that's right - try eliminating str() calls.


Comments

Popular posts from this blog

PHPMotion implementation - URL based videos (Hosted on separate location) -

c# - Unity IoC Lifetime per HttpRequest for UserStore -

I am trying to solve the error message 'incompatible ranks 0 and 1 in assignment' in a fortran 95 program. -