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

ut8decode return 1 character less #21

Open
Walter-Correa opened this issue Jun 23, 2020 · 6 comments
Open

ut8decode return 1 character less #21

Walter-Correa opened this issue Jun 23, 2020 · 6 comments

Comments

@Walter-Correa
Copy link

The sent word: Palhaço
Comes: Palhaço

After ut8decode: Palhaç

If sent: Palhaço de mérda
Comes: Palhaço de mérda

After ut8decode: Palhaço de mér (2 chars less)

@oscar-broman
Copy link
Owner

utf8 strings are not supported by any Pawn functions and only meant for special things such as binary encoding.

What is it you're trying to do?

@Walter-Correa
Copy link
Author

utf8 strings are not supported by any Pawn functions and only meant for special things such as binary encoding.

What is it you're trying to do?

I have a remote rcon ban/unban/kick/say system via admin ucp. The serve language is brazilian, so any characters like ãéçô sent via ucp need to be decoded.
Any solution?

@oscar-broman
Copy link
Owner

How is this information read into Pawn? Could you simply not just skip utf8 and encode it in the character sets used by Brazilians?

Could you go to your Windows settings and see which character set you use?

What programming language does your UCP use?

@Walter-Correa
Copy link
Author

How is this information read into Pawn? Could you simply not just skip utf8 and encode it in the character sets used by Brazilians?

public OnRconCommand(cmd[])
{
	new RParams[300],RCMD[40];
	sscanf(cmd, "s[40]s[300]", RCMD, RParams);

	if(IsSameStr(RCMD,"ucpsay"))
	{
		new text[256],admin[25];
		if(!sscanf(RParams, "s[25]s[300]",admin,text))
		{
			format(ChatString, sizeof(ChatString), "[ADMIN]: %s: {FFFFFF}%s",admin,text);
			foreach(new i : Player) SendClientMessage(i, AMARELO, ChatString);
			return 1;
		}
		return 1;
	}
	return 0;
}

What programming language does your UCP use?

Language: C#
Pages Charset: <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><meta charset="utf-8" />

In settings for ASP.NET applications:

Request encoding: utf-8
Response encoding: utf-8
File encoding: Windows-1252

@oscar-broman
Copy link
Owner

With that Rcon command, if you simply do printf("text: %s", text); what will that show in the server log?

@Walter-Correa
Copy link
Author

Rcon: Palhaço de mérda
Printf: Palhaço de mérda

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

No branches or pull requests

2 participants