SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 05/02/2020, 05:35 PM   #1
Davi52
Little Clucker
 
Join Date: Sep 2018
Posts: 40
Reputation: 0
Question Problem with character encoding

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
Davi52 is offline   Reply With Quote
Old 05/02/2020, 06:21 PM   #2
FireBoy89
Little Clucker
 
Join Date: Mar 2019
Location: Mars
Posts: 17
Reputation: 3
Default Re: Problem with character encoding

SAMP doesn't support UTF8 so you can't use utf8 encoding in SendClientMessage sadly. (SAMP only supports ASCII encoding at the moment)
FireBoy89 is offline   Reply With Quote
Old 06/02/2020, 01:43 PM   #3
Davi52
Little Clucker
 
Join Date: Sep 2018
Posts: 40
Reputation: 0
Default Re: Problem with character encoding

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?
Davi52 is offline   Reply With Quote
Old 07/02/2020, 05:51 AM   #4
RoboN1X
Huge Clucker
 
RoboN1X's Avatar
 
Join Date: Feb 2011
Location: Indonesia
Posts: 453
Reputation: 145
Default Re: Problem with character encoding

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.
__________________
Need Help? Use Search, WIKI, and FAQ
RoboN1X is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
pawn cyrilic encoding problem rhash Scripting Help 0 11/01/2020 03:19 PM
Sublime encoding problem. h4Xz0R Scripting Help 13 28/06/2014 07:41 PM
Encoding problem? Patchwerk Scripting Help 0 09/05/2014 03:19 PM
[HELP] SA-MP character encoding noambbv Scripting Help 0 06/10/2011 09:18 PM
SA-MP character encoding TomeK Help Archive 2 06/06/2009 12:04 PM


All times are GMT. The time now is 07:29 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.