question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

App.focus() on Windows not working with unicode characters in window title --- fixed 2019-03-05 build#220

See original GitHub issue

Bug status currently only workaround — fix will take time (bug tracking)

App("someApp.exe").focus() will not work, if the title of the 
frontmost app window contains unicode characters.

workaround:
App.focus("part of window title") will only work 
if the given string is ascii-only (no unicode characters),
but it will find and focus also windows, whose title contains Unicode characters.

So currently there is no way to focus apps/windows, whose window titles are completely unicode.

Hi I’ve just started to use Sikulix for my task. I have tested sikulix 1.1.4 2018-11-27_13:43 (Build 137) on Windows 10. When I tried to focus on app named with Unicode character, it failed with error “App.focus failed: no window for App_name_including_unicode_characters_and_English_also_PID” I’ve reviewed Sikulix code and realised that switchApp method in org/sikuli/natives/WinUtil.java line 332 not implemented. Probably because of this, focus() is not working? Sorry I’m not actively using Java but Python. Could you please fix this when you have time? Also, is there any better way to work around to set focus on the app easily? I assume it can be done with fidn images but except this 😃

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:12 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
RaiMancommented, Nov 29, 2018

focus() always returns the App instance, but does not guarantee that it worked (currently no reliable check internally).

so this does not really make sense:

    new_app = app_instance.focus()
    print("%s focused ? %s " % (app_instance.getName(), new_app.getName()))

To get all available info about an App instance, simply use

print "myApp:", myApp

App has a rather verbose toString() implementation.

1reaction
RaiMancommented, Nov 29, 2018

confirmed: does not work, if window title contains unicode character.

possible workaround: use a compound part of the window title, that does not contain any unicode characters.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unicode characters do not render correctly in a WPF ...
Describes an issue in which some Unicode characters in a WPF application do not render correctly in Windows 10.
Read more >
Some Unicode characters suddenly not displaying properly in ...
Windows 10 Version 20H2 (OS Build 19042.985) I'm finding that some of the more obscure Unicode characters have randomly stopped displaying ...
Read more >
Why does some text display with square boxes in some apps ...
When running certain apps on Windows 10 desktop or Windows 10 Mobile, some characters display as a square or rectangular box, or as...
Read more >
Hex Unicode input not working in Microsoft apps
There appear to be two different ways that the input method misbehaves: either it inserts nothing, or it inserts the wrong Unicode character....
Read more >
Unicode Characters Encoding Issue .Net core - Microsoft Q&A
Net core Application. Here are the details: When i submit a request through postman to my .net core web api with request body...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found