[GH-ISSUE #1472] Running command from WebUI on non-english Windows OS returns corrupted text. #2861

Open
opened 2026-03-14 05:44:52 +03:00 by kerem · 2 comments
Owner

Originally created by @HoniWhy on GitHub (Apr 4, 2023).
Original GitHub issue: https://github.com/amidaware/tacticalrmm/issues/1472

Server Info (please complete the following information):

  • OS: Debian GNU/Linux 11
  • Browser: Chome, Firefox
  • RMM Version: v0.15.8

Installation Method:

  • Standard
  • Docker

Agent Info (please complete the following information):

  • Agent version: v2.4.5
  • Agent OS: Win 10 21H1
  • OS Languge: Russian

Describe the bug

When executing command from Send command right click menu in WebUI the output you get is corrupted. Encoding issue?
When English is set as OS Language and the command is ran as user the issue is gone.

To Reproduce

  1. Client OS's language should be Russian
  2. In WebUI right click on a host => Send command
  3. Run command that gives output in Russian (CMD or Powershell)
  4. See encoding issues in command output

Expected behavior

Readable output in client OS language

Screenshots
image

Additional context

Same behavior is seen in Task/Script output.
MeshCentral's Remote Background Terminal works just fine.

When English is set as OS Language and the command is ran as user the issue is gone.
Changing browser language did not help the issue.

PS C:\Users\admin> Get-WinSystemLocale
LCID             Name             DisplayName
----             ----             -----------
1049             ru-RU            Russian (Russia)

TRMM server

root@test-trmm:~# cat /etc/default/locale
#  File generated by update-locale
LANG=en_US.UTF-8

Changing locale to ru_RU.utf8 (and other presented ru_ locales) changes nothing in command output.

Originally created by @HoniWhy on GitHub (Apr 4, 2023). Original GitHub issue: https://github.com/amidaware/tacticalrmm/issues/1472 **Server Info (please complete the following information):** - OS: Debian GNU/Linux 11 - Browser: Chome, Firefox - RMM Version: v0.15.8 **Installation Method:** - [x] Standard - [ ] Docker **Agent Info (please complete the following information):** - Agent version: v2.4.5 - Agent OS: Win 10 21H1 - OS Languge: Russian **Describe the bug** When executing command from _Send command right click menu_ in WebUI the output you get is corrupted. Encoding issue? When English is set as OS Language and the command is ran as user the issue is gone. **To Reproduce** 1. Client OS's language should be Russian 2. In WebUI right click on a host => Send command 3. Run command that gives output in Russian (CMD or Powershell) 4. See encoding issues in command output **Expected behavior** Readable output in client OS language **Screenshots** ![image](https://user-images.githubusercontent.com/129899664/229910660-0c850c3d-3efa-4dc8-9d48-0312b649e795.png) **Additional context** Same behavior is seen in Task/Script output. MeshCentral's Remote Background Terminal works just fine. When English is set as OS Language and the command is ran as user the issue is gone. Changing browser language did not help the issue. ```powershell PS C:\Users\admin> Get-WinSystemLocale LCID Name DisplayName ---- ---- ----------- 1049 ru-RU Russian (Russia) ``` **TRMM server** ```bash root@test-trmm:~# cat /etc/default/locale # File generated by update-locale LANG=en_US.UTF-8 ``` Changing locale to ru_RU.utf8 (and other presented ru_ locales) changes nothing in command output.
Author
Owner

@vsychov commented on GitHub (Dec 13, 2023):

You can try solution, from my comment in #1618

<!-- gh-comment-id:1853515580 --> @vsychov commented on GitHub (Dec 13, 2023): You can try solution, from my comment in #1618
Author
Owner

@Sug2077 commented on GitHub (Jan 24, 2024):

you can add chcp 65001 > nul at bat scripts head

and [Console]::OutputEncoding = [System.Text.Encoding]::UTF8 at powershell scripts head

when you send commands to windows agent, you can use chcp 65001 > nul && you-command

These methods avoid changing the user's computer Settings.

<!-- gh-comment-id:1907677820 --> @Sug2077 commented on GitHub (Jan 24, 2024): you can add `chcp 65001 > nul` at bat scripts head and `[Console]::OutputEncoding = [System.Text.Encoding]::UTF8` at powershell scripts head when you send commands to windows agent, you can use `chcp 65001 > nul && you-command` **These methods avoid changing the user's computer Settings.**
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/tacticalrmm#2861
No description provided.