← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #670783]: Different character encoding when using CMD instead of IDE

 

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

    Status: Open => Answered

RaiMan proposed the following answer:
using print?

if yes: try with uprint()

this is from the sources (Lib/sikuli/Sikuli.py):

##
# some support for handling unicode and strings
#
## use instead of print if unicode strings present
# usage: uprint(s1, u1, u2, u3, s3, ...)
#
def uprint(*args):
  for e in args[:-1]:
    if isinstance(e, str):
      print e,
    else:
      print e.encode("utf8"),
  if isinstance(args[-1], str):
    print args[-1]
  else:
    print args[-1].encode("utf8")

##
# to make an utf8-encoded string from a str object
#
def unicd(s):
  return ucode(s)

def ucode(s):
  return (unicode(s, "utf8"))

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.