Page 1 of 1

Japanese and Chinese character support

Posted: Wed Feb 06, 2013 6:44 pm
by gurpreet singh
I'm am not able to get japanese or chinese character properly.
I am using python 2.5.

Code: Select all

 import RanorexPython as Ranorex
Ranorex.ControlGetText(combobox)
In output i'm getting ?? in place of japanese or chinese character.

Re: Japanese and Chinese character support

Posted: Wed Feb 06, 2013 6:55 pm
by Support Team
gurpreet singh wrote:I'm am not able to get japanese or chinese character properly.
I am using python 2.5.
Which Ranorex version do you use?
Unicode (including Japanese and Chinese) characters are supported since version 2.0.

Regards,
Alex
Ranorex Team

Re: Japanese and Chinese character support

Posted: Thu Feb 07, 2013 6:29 am
by gurpreet singh
i'm using python 2.5.1 but i dont know version of ranorex because it is embeded python script.
Ranorex version is "Ranorex-1.5.3.6580" as mentioned in exe.

Code: Select all

import os, sys, optparse, imp
import RanorexPython as Ranorex
import os.path
import win32api
import time

def main():

    timeScale = 1.0
    Ranorex.ElementIgnoreInvisible(1)

    form = Ranorex.FormFindTitle("Properties", Ranorex.MATCH_SUBSTRING)
    if form == 0:
        return 1
    Ranorex.FormActivate(form)

    editPath = Ranorex.FormFindChildControlId(form, 6745)
    if editPath == 0:
        return 1
    Ranorex.ControlSetFocus(editPath)

    Ranorex.ControlSendKeys(0, "", 500)
    dPath = Ranorex.ControlGetText(editPath)

    editControl = Ranorex.FormFindChildControlId(form, 6746) 
    if editControl == 0:
        return 1
    Ranorex.ControlSetFocus(editControl);

    controlElement = Ranorex.ControlGetElement(editControl)
    if controlElement == None:
        return 1
    time.sleep(2)

    Ranorex.ControlSendKeys(0, "", 500)
    Path = Ranorex.ControlGetText(editControl)

    writePath = dPath + "\n" + cPath
    tempfile = open("C:\\Temp\\pathfile.txt", "w")
    tempfile.writelines(writePath)
    tempfile.close()
i have pasted the code to more clear the things.

Re: Japanese and Chinese character support

Posted: Thu Feb 07, 2013 9:52 am
by Support Team
gurpreet singh wrote:Ranorex version is "Ranorex-1.5.3.6580".
As stated before, Ranorex 1.X does not support Unicode characters, sorry!
You need to update to a newer (not outdated) Ranorex version. You can download the current version from the following website and use it for a 30 day trial period:
http://www.ranorex.com/download.html

Regards,
Alex
Ranorex Team