cesbit / aiowmi

Python WMI Queries
GNU General Public License v3.0
27 stars 8 forks source link

Problem with charsets on replies from wmicserver with Windows in spanish #27

Open trentasis opened 1 year ago

trentasis commented 1 year ago

Hi, I’m having a problem where my wmic client makes a petition to wmicserver but receives a message with the wrong Charset.

This is the message in question:

OK – Found 1 Services(s), 1 OK and 0 with problems (0 excluded). ‘Administraci▒n de licencias de Escritorio remoto’ (TermServLicensing) is Running.|’Total Service Count’=1; ‘Service Count OK State’=1;;1; ‘Service Count Problem State’=0; ‘Excluded Service Count’=0;

As you can see… Administraci▒n accents fail.

Do you know a solution for this?

Windows is in Spanish.

joente commented 1 year ago

Not sure, but in encoded_string.py the library does the string encoding. It basically decodes using utf-16le.

joente commented 1 year ago

Could you try using the plain library without the wmicserver?

trentasis commented 1 year ago

With simple wmic client it works well, but when i use wmicserver i have that problem

would you recommend to change the enconding in encoded_string.py for another one?

trentasis commented 1 year ago

Hi, does anyone else know what to do about this problem?

joente commented 1 year ago

@trentasis , I've created pr #28 with the encoding forced to UTF-8. Can you test if this solves the issue?

trentasis commented 1 year ago

Hi, i tested it and still having the same issue:

OK - Found 1 Services(s), 1 OK and 0 with problems (0 excluded). 'Administraci▒n de licencias de Escritorio remoto' (TermServLicensing) is Running.|'Total Service Count'=1; 'Service Count OK State'=1;;1; 'Service Count Problem State'=0; 'Excluded Service Count'=0;

This if from nagios making a request to wmicserver, and wmicserver asking to a Windows Server in Spanish.