mozillahispano / smw-reminder

Email reminders for semantic mediawiki data
http://www.mozilla-hispano.org
6 stars 3 forks source link

fix encoding #2

Closed ccarruitero closed 12 years ago

ccarruitero commented 12 years ago

I has a problem with unicode encoding when I try to insert in string

I ignore encoding for test if bash is working,

label = unicodedata.normalize('NFKD',tareas['items'][int(i)]['label']).encode('latin-1','ignore')

but it's necessary resolve this

willyaranda commented 12 years ago

I don't understand this. Can you ellaborate again, please?

ccarruitero commented 12 years ago

for the mail message, I request data from jsons, something like this:

respon = tareas_new['respon'+str(i)][0]
estado = tareas['items'][int(i)]['estado'][0]
label = tareas['items'][int(i)]['label']

and then insert this in the message ..

text = "Hola, "+ respon + " tienes asignada la tarea "+ label+", la cual se encuentra como " + estado +" ... "

But I have error with encoding with this variable. I ignore this encoding for test bash is working, but is necessary fix this

It's better?

willyaranda commented 12 years ago

Using this

text = u"Hola, %s tienes asignada la tarea %s, la cual se encuentra como %s, pero ya vencio la fecha limite asignada" % (respon, label, estado)

should work