0

I'm making a uiautomator based application where the app touches the objects based on text. I've written the uiautomator methods in Java and have made a C# app which asks the used which text to touch. I'm using cmd/adb to execute the uiautomator commands.

The problem comes when I change the phone language to something other than English. Cmd/adb replaces the text (in other language) with ???. It passes the same to uiautomator. Is there a way I can make cmd understand the other language?

C# code

            Process procToExecute = new Process();
            procToExecute.StartInfo.FileName = "adb.exe";                
            procToExecute.StartInfo.Arguments = strCommand;                 
            procToExecute.StartInfo.CreateNoWindow = true;
            procToExecute.StartInfo.UseShellExecute = false;
            procToExecute.StartInfo.RedirectStandardOutput = true;
            procToExecute.StartInfo.RedirectStandardInput = true;
            Thread.Sleep(1500);
            procToExecute.Start();
            procToExecute.WaitForExit();

where strCommand looks like this for other languages

adb shell uiautomator runtest UiAutomatorTest.jar -c com.lge.uiautomatorTest.UiAutomatorClass#UiEnterText -e edit संदेश%दर्ज%करें -e text को

and it shows like this on cmd

adb shell uiautomator runtest UiAutomatorTest.jar -c com.lge.uiautomatorTest.UiAutomatorClass#UiEnterText -e edit ?????%????%???? -e text ??
Anand S Kumar
  • 88,551
  • 18
  • 188
  • 176
Ekta
  • 338
  • 2
  • 9
  • 26
  • take a look at this answer http://stackoverflow.com/a/2628727/1805974 it might just be that the commandline cannot show the characters, however the problem might be the java program, that needs to use utf16 for reading arguments – Henrik Bøgelund Lavstsen Jun 24 '15 at 10:23
  • This is not aboput languages but about fonts and codepages! – TaW Jun 24 '15 at 10:41
  • @HenrikBøgelundLavstsen Nope.. If I hard code the value in my java file, it works fine.. So I'm not sure if the problem is with the Java file. – Ekta Jun 25 '15 at 04:52

0 Answers0