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

Encoding errors #646

Closed
MariaCamilaCubides opened this issue Jan 22, 2022 · 5 comments
Closed

Encoding errors #646

MariaCamilaCubides opened this issue Jan 22, 2022 · 5 comments

Comments

@MariaCamilaCubides
Copy link
Contributor

Describe the bug
Hi. I was doing some tests and I found some errors in my devices related to #616 issue. I found an error in users with the character ñ. And the other issue is with the accents (á, é, ó) in graphics and networks.

image
image

I already had this kind of issue and it was solved in other devices sending commands through PowerShell and adding $OutputEncoding = [System.Console]::OutputEncoding = [System.Console]::InputEncoding = [System.Text.Encoding]::UTF8 ; so I did some test and notice that this issue occurs in devices with Windows 8.1 and PowerShell 4.0

I tested the $OutputEncoding directly in PowerShell and then I run some commands whose results have special characters and it started failing.

@sebhildebrandt
Copy link
Owner

@MariaCamilaCubides ... so I don't know If I understood you correctly. You mean, that I should just SKIP the $OutputEncoding = [System.Console]::OutputEncoding = [System.Console]::InputEncoding = [System.Text.Encoding]::UTF8 ; ?

Can you verify this on your side - when you blank out the _psToUTF8 variable in the lib/utils.js ... Dows it then give correct output?

Thank you for your support.

@sebhildebrandt
Copy link
Owner

sebhildebrandt commented Jan 23, 2022

@MariaCamilaCubides I testet the current version once again (no changes) with a user with special characters in the name and it worked fine. Tests were done on Windows 11 ...

┌────────────────────────────────────────────────┐
│  Users                               v: 5.10.6 │
└────────────────────────────────────────────────┘
[
  {
    user: 'Sebastian',
    tty: '1',
    date: '2022-01-23',
    time: '15:48',
    ip: '',
    command: ''
  },
  {
    user: 'Téstéöäü',
    tty: '2',
    date: '2022-01-23',
    time: '19:10',
    ip: '',
    command: ''
  }
]
Time to complete: 2.149s

Can you maybe provide more detailed information about your environment?

@MariaCamilaCubides
Copy link
Contributor Author

@sebhildebrandt I tried the current version on Windows 10, 11 and it works fine. I have this problem on Windows 8.1, however, I did a different test on Windows 8.1 and found that the problem is related to the PowerShell version.
The default version of PowerShell on Windows 8.1 is version 4.0, but this version doesn't support encoding which is set with _psToUTF8, I also removed this and tried sending the command alone, without encoding the information, but the error persists.
On the same device that has the problem, I updated the version of PowerShell to 5.1, and this way the error disappears.

@sebhildebrandt
Copy link
Owner

@MariaCamilaCubides thank you so much for your research on this one!! Seems that I cannot really remove this issue with PowerShell version 4. So I need to describe this clearly in the docs. Ok for you to close this?

@sebhildebrandt
Copy link
Owner

@MariaCamilaCubides I added information about encoding problems with older powerShell versions to the issues section in the documentation https://systeminformation.io/issues.html - closing this for now.

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

No branches or pull requests

2 participants