Southclaws / sampctl

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

sampctl is not encoding to ANSI #447

Open SimonOre opened 2 years ago

SimonOre commented 2 years ago

I just started to test the sampctl tool to update YSI but found a problem when configuring the server. The server.cfg file is being encoded to utf8 by default which causes the ñ letter translates to ñ, more letters includes á, é, í, ó My pawn.json

"runtime": {
        "mode": "y_testing",
        "rcon_password": "private",
        "announce": false,
        "maxplayers": 400,
        "port": 7777,
        "rcon": false,
        "sleep": 1,
        "maxnpc": 200,
        "language": "Español/Portuguese"
    }

Opening the file server.cfg with Notepad++ and changing the encoding from UTF8 to ANSI produces the same result as the started server using sampctl package run:

language Español/Portuguese

HostName: Update YSI
Address:  localhost:7777
Players:  0 / 400
Ping:     19
Mode:     Unknown
Language: Español/Portuguese

Workaround is opening the server.cfg file, changing the encode to ANSI and retype the letter

EDIT: The problem is also present when editing a gamemode and compiling it

#include <a_samp>
#include <YSI_Data\y_foreach>
main(){}

public OnGameModeInit()
{
    print("It works!");
}

public OnPlayerConnect(playerid)
{
    foreach (new i : Player) {
        SendClientMessage(playerid, -1, "Prúeba de ñ");
    }
}
ADRFranklin commented 1 year ago

@SimonOre I'll take a look at this in future releases

pedropapa commented 1 year ago

you could use ISO-8859-1 which is supported by the pawn compiler and also by modern IDE's like VSCode.