Problem with character encoding
#1

Hey! Im getting problems with loading datas from MySQL. So on the MySQL table the text is : "Életálom",but as I get it with the query, and write it out with SendClientMessage(tried with dialog), it sends me:"Életálom".
I tried this
Code:
mysql_set_charset("utf8_hungarian_ci", sql);
mysql_query (sql, "SET NAMES utf8_hungarian_ci");
to put it after connection, but it's not working. Ensured that the sql table column encoding is "utf8_hungarian_ci". Any ideas how to fix this? Thanks :O
Reply
#2

SAMP doesn't support UTF8 so you can't use utf8 encoding in SendClientMessage sadly. (SAMP only supports ASCII encoding at the moment)
Reply
#3

But the funny is that if I write some hungarian character directly in SendClientMess function, it's ok, it has no problems, only if I receive them from sql. Any ideas pls?
Reply
#4

Pretty sure you wanted to use latin2_hungarian_ci instead.

Quote:
Originally Posted by FireBoy89
View Post
(SAMP only supports ASCII encoding at the moment)
"SAMP only supports ASCII encoding" is misleading, what you write in SendClientMessage codes will follow your pawn compiler charset setting. How the message would display in the client will follow the player system / language setting, otherwise a wrong byte character or "?" mark would show for them.

If you meant that ASCII is only supported for "char"-array, then it is limited to PAWN only as SA-MP functions do not provide use for packed strings at all.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)