← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #204773]: Using type() with spanish characters: Cannot convert character

 

Question #204773 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/204773

    Status: Answered => Solved

fernando gandini confirmed that the question is solved:
ok, for now i just use .replace to substitute the characters that ascii not recognize.
thanks RaiMan

def tiradorDeCaracteres(texto):

    dic = { "á": "a", "é": "e", "í": "i", "ó": "o", "ú": "u",
      "à": "a", "è": "e", "ì": "i", "ò": "o", "ù": "u",
      "â": "a", "ê": "e", "î": "i", "ô": "o", "û": "u",
      "ã": "a", "õ": "o", "ñ": "n", "ç":"c",
      "Á": "A", "É": "E", "Í": "I", "Ó": "O", "Ú": "U",
      "À": "A", "È": "E", "Ì": "I", "Ò": "O", "Ù": "U",
      "Â": "A", "Ê": "E", "Î": "I", "Ô": "O", "Û": "U",
      "Ã": "A", "Õ": "O", "Ñ": "N", "Ç": "C",
      "Ü": "U", "û":"u", "Ä":"A", "ä":"a", "Ë":"E", "ë":"e",
      "Ï":"I", "ï":"i", "Ö":"O", "ö":"o", "Ü":"U", "ü":"u", "ð":"?", "ß":"ss",
      "Å":"A","å":"a", "ø":"o", "Ø":"O", "Þ":"?" , "æ":"ae",
      "~":"","^":"","`":"", "´":"","&":"","@":"","%":"","ª":"","¢":""         
      }

    for i, j in dic.iteritems():
        texto = texto.replace(i, j)
    return texto

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.