← Back to team overview

sikuli-driver team mailing list archive

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

 

New question #385878 on Sikuli:
https://answers.launchpad.net/sikuli/+question/385878

Hi. Pls Help.

I'm receiving error "UnicodeEncodeError ( 'ascii' codec can't encode character u'\u2018' in position 1: ordinal not in range(128) )"
when I run the code below:

I receive the error on line "print(text)".  

for i in range(0,1):
    
    #Start With Ref Format=1080i 5994 and Vid Format=1080i 5994
    find(Pattern("1471447653278.png").similar(0.76))
    wait(5)
    click(Pattern("1471448707420.png").similar(0.86))


    wait(5)

    click(Pattern("1471541243372.png").similar(0.67))

    wait(1)

    click(Pattern("1471541696005.png").similar(0.81))

    wait(1)
    click("1471543728813.png")
    wait(1)

    dragDrop("1472737655087.png", "1472737658144.png")


    wait(1)
    click("1472225690263.png")
    wait(1)
    click(Pattern("1472225867442.png").exact().targetOffset(32,4))

    wait(1)

    click("1471544850433.png")
    wait(1)

    click(Pattern("1471545216904.png").exact())

    wait(1)

    click(Pattern("1471545302310.png").exact())


    wait(1)
    click(Pattern("1471542131103.png").similar(0.83))


    wait(1)
    click("1471542350506.png")


    wait(1)
    click("1471542387103.png")

    wait(1)
    click(Pattern("1471542511442.png").targetOffset(-1,5))

    wait(1)
    
    click(Pattern("1471542557583.png").targetOffset(-6,1))


    wait(1)
    click("1471542616130.png")


    wait(1)

    click("1471542659502.png")

    wait(1)

    click("1471542717658.png")


    wait(1)
    click("1471542745630.png")

    wait(1)

    click(Pattern("1471545920599.png").similar(0.77).targetOffset(-30,-7))


    wait(1)
    click(Pattern("1471545978322.png").similar(0.85).targetOffset(-63,0))

    #Ref Format=480i and Vid Format=1080i 5994

    wait(1)
    click(Pattern("1471547733935.png").exact().targetOffset(0,144))

    wait(1)

    click("1471546107904.png")


    wait(1)
    click("1471546146086.png")

    wait(1)

    dragDrop("1471546231654.png", "1471546234848.png")

    wait(5)


    click(Pattern("1472234263933.png").exact())
    wait(1)
    click(Pattern("1472234474621.png").exact().targetOffset(30,3))

    wait(5)

    click("1471546339509.png")

    wait(1)

    click(Pattern("1471546542993.png").similar(0.93).targetOffset(-1,4))

    wait(1)


    r=find("1472846592190.png").below(100)
    t=r.find("1472846217430.png")
    click(t)

    wait(1)
    click("1471546728265.png")

    wait(1)

    click("1471546760759.png")

    wait(1)
    click("1471546791403.png")

    wait(1)
    click("1471546821745.png")


    wait(1)


    click("1471546854350.png")


    wait(1)


    click(Pattern("1471550741814.png").exact().targetOffset(-35,7))


    wait(1)
    click(Pattern("1471546969012.png").similar(0.90).targetOffset(-62,1))

    wait(12)

    #Verify Ref Format Returns to 1080i 5994 and Vid Format Returns to 1080i 5994

    Settings.OcrTextRead = True
    reg=find(Pattern("1473260102302.png").targetOffset(-9,50))
    
    text = reg.text()
    print(text)             ********I receive error here*******

    if "1080" in text:
        if "59.94" in text:
            print("it is 1080 and 59.94")
        else:
            print("Not 59.94")
    else:
        print("Not 1080")       


    wait(5)

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