[HELP] Characters Encoding Error
#1

Hello,

So all suddenly special chars like "бзйй" etc won't appear, and i'm freaking out trying to figure out what's wrong!


Код:
stock KickMessage(playerid, message[]) {
	new strMessage[144];
	format(strMessage, sizeof(strMessage), "%s: %s", SERVER_PREFIX, message);
	SendClientMessage(playerid, COLOR_WHITE, strMessage);
	
	SetTimerEx("_KickMessage", 250, false, "i", playerid);
	return 1;
}

callback:_KickMessage(playerid) {
	Kick(playerid);
	return 1;
}
Код:
Dialog:LoginDialog(playerid, response, listitem, inputtext[]) {
	if(response) {
		return 1;
	} else {
		KickMessage(playerid, "Autenticaзгo obrigatуria. ййй");
		return 1;
	}
}
I'm killing my brain trying to figure out what happened. Could please someone tell me what's going wrong? I'm out of ideas/fixes.

Thanks...


-------------
SOLUTION FOUND:
Quote:
Originally Posted by thewildlima
Посмотреть сообщение
Ok, so, this is a bug ( i think ), thats how i solved this (weirdly), i discovered that Pawn automatically saves files in ANSI, so i'm my thinking this is what was happening:

LimaRP.pwn is saved in ANSI.
All the custom includes are in UTF-8.
In the compilation/build, UTF-8 characters will be shown as ANSI, and it causes the characters to appear like in the above attachments.

Solution: Change all files/includes back to ANSI.

Check in the attachments.

Hope this thread will help future scripters with the same issue !

Thanks to everyone who tried to help so quickly !
Reply
#2

SA-MP can't format some of the letters,the biggest example of that is when you use the '%' sign in SA_MP chat and it automatically converts into '#'
Reply
#3

Quote:
Originally Posted by K0P
Посмотреть сообщение
SA-MP can't format some of the letters,the biggest example of that is when you use the '%' sign in SA_MP chat and it automatically converts into '#'
Then why moments ago it was working, now don't ?!
Reply
#4

Quote:
Originally Posted by thewildlima
Посмотреть сообщение
Then why moments ago it was working, now don't ?!
hmm,thats weird,ive never faced a problem like this/

Try this :-

Код:
stock KickMessage(playerid, message[]) {
	new strMessage[144];
	format(strMessage, sizeof(strMessage), "%s: %s", SERVER_PREFIX, message);
	SendClientMessage(playerid, COLOR_WHITE, strMessage);

	SetTimerEx("Kick", 1000, false, "i", playerid);
	return 1;
}

forward Kick(playerid)
public Kick(playerid)
{
    Kick(playerid);
    return 1;
}

Dialog:LoginDialog(playerid, response, listitem, inputtext[]) {
	if(response) {
		return 1;
	} else {
		KickMessage(playerid, "Autenticaзгo obrigatуria. ййй");
		return 1;
	}
}
Reply
#5

Open file with Notepad++. Go to the charset menu and make sure that it is set to UTF-8 (without BOM) and not ANSI. If it isn't, set it to that. Save file and then try to compile again.
Reply
#6

Quote:
Originally Posted by K0P
Посмотреть сообщение
hmm,thats weird,ive never faced a problem like this/

Try this :-

Код:
stock KickMessage(playerid, message[]) {
	new strMessage[144];
	format(strMessage, sizeof(strMessage), "%s: %s", SERVER_PREFIX, message);
	SendClientMessage(playerid, COLOR_WHITE, strMessage);

	SetTimerEx("Kick", 1000, false, "i", playerid);
	return 1;
}

forward Kick(playerid)
public Kick(playerid)
{
    Kick(playerid);
    return 1;
}

Dialog:LoginDialog(playerid, response, listitem, inputtext[]) {
	if(response) {
		return 1;
	} else {
		KickMessage(playerid, "Autenticaзгo obrigatуria. ййй");
		return 1;
	}
}
Let me try, but btw the "callback:" is a macro!

Код:
#define callback:%0(%1) forward %0(%1);public %0(%1)
Reply
#7

Quote:
Originally Posted by thewildlima
Посмотреть сообщение
Let me try, but btw the "callback:" is a macro!

Код:
#define callback:%0(%1) forward %0(%1);public %0(%1)
Oh alright,i didn't knew it was defined
Reply
#8

Quote:
Originally Posted by Vince
Посмотреть сообщение
Open file with Notepad++. Go to the charset menu and make sure that it is set to UTF-8 (without BOM) and not ANSI. If it isn't, set it to that. Save file and then try to compile again.
Thanks, i double, triple, quadruple checked that before making this thread.

As you can see in attachments.
Reply
#9

Quote:
Originally Posted by Vince
Посмотреть сообщение
Open file with Notepad++. Go to the charset menu and make sure that it is set to UTF-8 (without BOM) and not ANSI. If it isn't, set it to that. Save file and then try to compile again.
Vince 'ma men! It looks the .pwn file was the ugly sheep!

I went to check it on Notepad++ and it was in ANSI. I'm gonna change it and try it out.
Reply
#10

Ok, so, this is a bug ( i think ), thats how i solved this (weirdly), i discovered that Pawn automatically saves files in ANSI, so i'm my thinking this is what was happening:

LimaRP.pwn is saved in ANSI.
All the custom includes are in UTF-8.
In the compilation/build, UTF-8 characters will be shown as ANSI, and it causes the characters to appear like in the above attachments.

Solution: Change all files/includes back to ANSI.

Check in the attachments.

Hope this thread will help future scripters with the same issue !

Thanks to everyone who tried to help so quickly !
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)