Southclaws / sampctl

The Swiss Army Knife of SA:MP - vital tools for any server owner or library maintainer.
GNU General Public License v3.0
242 stars 33 forks source link

Special characters aren't correct on sampctl #416

Closed ghost closed 3 years ago

ghost commented 3 years ago

When I start sampctl package run from Windows CMD or Visual Studio Code, special characters aren't correct on sampctl. But when I start samp-server.exe special characters are fine. It's not related to cmd chcp or UTF-8 because it's same when I use Windows-1254, it's related to sampctl I think. also those characters are Turkish special characters.

vscode terminal, sampctl package run image

sampctl from cmd, sampctl package run image

samp-server.exe image

the code: image

ADRFranklin commented 3 years ago

In future can you post the actual code you are trying to make work? I can't reproduce these characters cause I have no idea where to get them from.

Please do not post images of code.

Southclaws commented 3 years ago

This is odd because afaik the output is simply copied from the server process stdout to the sampctl stdout.

ADRFranklin commented 3 years ago

It's possible this not related to sampctl at all, and is related to the terminal/shell he is running it in. It could be forcing an encoding that is messing the output of sampctl.

The reason it is not shown in the "samp-server.exe" is because this is using the default windows command with default settings to output, which is normal for any console application.

RiqueCool commented 3 years ago

I'm having the same problem. I'm Brazilian, and when: Português -> Portugu�s

ghost commented 3 years ago

I tried on Windows 10 Terminal (the app from Microsoft Store), built-in powershell, cmd, and i tried on windows 7 powershell and cmd. It's same, also the characters şğüçölöıİ you can try to print them. I think it's about unicode because as rique said it's not only in Turkish.

ADRFranklin commented 3 years ago

https://i.imgur.com/Bhn7ily.png

This works fine for me?

main()
{
    printf("Las Venturas Crew Wars - 2021 (şğüçölöıİ)");
}
NegativeIQ commented 3 years ago

Could be related to "System locale" in Windows itself. Basically its like fallback encoding (thats probably wrong explanation but i have no idea how to describe it)

Try changing it to yours (Change system locale button in picture) image

That is from Windows 7, and you can find it in Control panel, Region and Language