← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #265734]: UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in position 1: ordinal not in range(128)

 

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

Description changed to:
********* question
what is the difference between
App.getClipboard(); and
Env.getClipboard() ????
********** answer
no diff.
App is the recommended use, using Env is deprecated.
the feature is implemented in class App

------------------------------------------------

I have this message when importing clipboard (containing a List) that was obtained from an OCR capture (third app)
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in position 1: ordinal not in range(128)

I have used Env.getClipboard().encode('utf-8') and it allow the script to run even with those utf-8 characters,
but in Sikuli IDLE Message Tab those characters are show in strange code eg (é = \xc3\xa9)
Since I need to make a Fuzzy String Matching with those List's items. Should I delete them with regex before importing to sikuli, or Sikuli could work with those rare characters in strings?
Please could you tell me which are the most common allowed ascii characters in sikuli (python) list, variables, items. So I can delete all the rest using regex. what other characters should I avoid besides utf-8??

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