Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with cyrillic charset #9

Open
cvtk opened this issue Mar 10, 2021 · 3 comments
Open

Problem with cyrillic charset #9

cvtk opened this issue Mar 10, 2021 · 3 comments

Comments

@cvtk
Copy link

cvtk commented Mar 10, 2021

{
os: 'windows',
windowClass: 'chrome.exe',
windowName: "╨Ф╨╢╨╕╨╜╤Б╤Л 511 Slim Fit Levi's┬о 6407635 ╨║╤Г╨┐╨╕╤В╤М ╨╖╨░ 3┬а544┬атВ╜ ╨▓ ╨╕╨╜╤В╨╡╤А╨╜╨╡╤В-╨╝╨░╨│╨░╨╖╨╕╨╜╨╡ Wildberries - Google Chrome",
windowDesktop: '0',
windowType: '0',
windowPid: '9608',
idleTime: '0'
}
{
os: 'windows',
windowClass: 'chrome.exe',
windowName: "╨Ф╨╢╨╕╨╜╤Б╤Л 511 Slim Fit Levi's┬о 6407635 ╨║╤Г╨┐╨╕╤В╤М ╨╖╨░ 3┬а544┬атВ╜ ╨▓ ╨╕╨╜╤В╨╡╤А╨╜╨╡╤В-╨╝╨░╨│╨░╨╖╨╕╨╜╨╡ Wildberries - Google Chrome",
windowDesktop: '0',
windowType: '0',
windowPid: '9608',
idleTime: '0'
}
{
os: 'windows',
windowClass: 'chrome.exe',
windowName: '╨Ъ╤Г╨┐╨╕╤В╤М ╨╝╤Г╨╢╤Б╨║╨╕╨╡ ╨┤╨╢╨╕╨╜╤Б╤Л ╨▓ ╨╕╨╜╤В╨╡╤А╨╜╨╡╤В ╨╝╨░╨│╨░╨╖╨╕╨╜╨╡ WildBerries.ru - Google Chrome',
windowDesktop: '0',
windowType: '0',
windowPid: '9608',
idleTime: '0'
}
{
os: 'windows',
windowClass: 'chrome.exe',
windowName: '╨Ъ╤Г╨┐╨╕╤В╤М ╨╝╤Г╨╢╤Б╨║╨╕╨╡ ╨┤╨╢╨╕╨╜╤Б╤Л ╨▓ ╨╕╨╜╤В╨╡╤А╨╜╨╡╤В ╨╝╨░╨│╨░╨╖╨╕╨╜╨╡ WildBerries.ru - Google Chrome',
windowDesktop: '0',
windowType: '0',
windowPid: '9608',
idleTime: '0'
}
{
os: 'windows',
windowClass: 'chrome.exe',
windowName: '╨Ъ╤Г╨┐╨╕╤В╤М ╨╝╤Г╨╢╤Б╨║╨╕╨╡ ╨┤╨╢╨╕╨╜╤Б╤Л ╨▓ ╨╕╨╜╤В╨╡╤А╨╜╨╡╤В ╨╝╨░╨│╨░╨╖╨╕╨╜╨╡ WildBerries.ru - Google Chrome',
windowDesktop: '0',
windowType: '0',
windowPid: '9608',
idleTime: '0'
}
{
os: 'windows',
windowClass: 'chrome.exe',
windowName: '╨Ъ╤Г╨┐╨╕╤В╤М ╨╝╤Г╨╢╤Б╨║╨╕╨╡ ╨┤╨╢╨╕╨╜╤Б╤Л ╨▓ ╨╕╨╜╤В╨╡╤А╨╜╨╡╤В ╨╝╨░╨│╨░╨╖╨╕╨╜╨╡ WildBerries.ru - Google Chrome',
windowDesktop: '0',
windowType: '0',
windowPid: '9608',
idleTime: '0'
}

@yvesh
Copy link
Owner

yvesh commented Mar 12, 2021

Yes, Windows is sometimes a mess with it's charsets. Not even sure which one it's using for cyrillic / russian (not UTF-8 it seems). Have it on my todo-list - PRs welcome though!

@cvtk
Copy link
Author

cvtk commented Mar 29, 2021

@yvesh Hi!
I would like to take part, but there is only one thing better than my C++ code - my poor english

@nodgear
Copy link

nodgear commented Apr 4, 2021

Hey! i'm currently using FFI so i don't know if it's going to be of any help, but i am currently getting the correct window names this way:

 const buf = new Buffer.alloc(1024)
  const ret = win32.GetWindowTextW(hwnd, buf, 1024)
  const name = buf.toString('ucs2').replace(/\0+$/, '')

Where win32 is the user32 dll via ffi-napi library.

@edit: this does include emojis. Windows seems to not have a limit for window title size so it may be a problem sometimes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants