I have a problem
When a player swears I want it to be stored in the database
But the problem it is saved as question marks
the langauage is : arabic
how can I solve it please?
problem with saving in database
Re: problem with saving in database
Hi,
both SFS PRO and SFS2X are already configured to work with UTF-8, so all languages are supported out of the box.
When it comes to storing data to a database you need to make sure your database tables support UTF-8
I don't know what DB you're using, if it's MySQL take a look at this article:
https://stackoverflow.com/questions/685 ... l-database
Hope it helps
both SFS PRO and SFS2X are already configured to work with UTF-8, so all languages are supported out of the box.
When it comes to storing data to a database you need to make sure your database tables support UTF-8
I don't know what DB you're using, if it's MySQL take a look at this article:
https://stackoverflow.com/questions/685 ... l-database
Hope it helps
Re: problem with saving in database
Hello,
I'm using mysql and my database tables support UTF-8
The problem isn't in the database because I can add arabic words from the database without any problems.
I programmed sfs to send the swears to the database that the player uses .
The problem is SFS send the arabic swears to the database that the player uses as ???????? (question marks).
I'm using mysql and my database tables support UTF-8
The problem isn't in the database because I can add arabic words from the database without any problems.
I programmed sfs to send the swears to the database that the player uses .
The problem is SFS send the arabic swears to the database that the player uses as ???????? (question marks).
Re: problem with saving in database
If you are using a word filter, then the swear words are replaced with ??? in the chat.
Once this is done, you cannot revert them back to the original. In that case there is no way to maintain the original message, I am sorry.
Maybe what you need to do is intercept the ???? as a signal of someone searing and then you can apply your own logic. Keep in mind that something like this already exists, however. Meaning that SFS2X can already keep count of how many curse words have been sent in one session and either kick the user or banish him/her for a while.
Hope it helps
Once this is done, you cannot revert them back to the original. In that case there is no way to maintain the original message, I am sorry.
Maybe what you need to do is intercept the ???? as a signal of someone searing and then you can apply your own logic. Keep in mind that something like this already exists, however. Meaning that SFS2X can already keep count of how many curse words have been sent in one session and either kick the user or banish him/her for a while.
Hope it helps
Re: problem with saving in database
Am using sfs pro
When the player swears the server kicks him.
But I want the server to send the swears to the database.
The server sends the swears but if the swears are arabic they reach the database as ???????
But if the swears are english they reach the database as they are without any problems.
So the problem is just in the arabic swears when they reach the database they reach as ?????? , what shall I do?
When the player swears the server kicks him.
But I want the server to send the swears to the database.
The server sends the swears but if the swears are arabic they reach the database as ???????
But if the swears are english they reach the database as they are without any problems.
So the problem is just in the arabic swears when they reach the database they reach as ?????? , what shall I do?
Re: problem with saving in database
Your issue appears to be unrelated to Smartfoxserver , Please make sure that your database and table collations are set to utf8_general_ci
Re: problem with saving in database
I said I made sure of that. @alex
I can add arabic words from the database
The problem is in SFS PRO because it sends the arabic words as ????????? to the database
Is there a code to write in "as" files to solve this problem lapo?
I can add arabic words from the database
The problem is in SFS PRO because it sends the arabic words as ????????? to the database
Is there a code to write in "as" files to solve this problem lapo?
Re: problem with saving in database
Hi,
if the chat works in arabic, meaning that people chatting in arabic can read their respective messages, then it's not an issue with the server. If it were you would see bad characters in the chat as well.
Can you show me the details of your Java Runtime? When the server starts up it will log a series of system info, like this:
Thanks
if the chat works in arabic, meaning that people chatting in arabic can read their respective messages, then it's not an issue with the server. If it were you would see bad characters in the chat as well.
Can you show me the details of your Java Runtime? When the server starts up it will log a series of system info, like this:
Code: Select all
jvm 1 | --- [ System Info ] ------------------------------------------
jvm 1 |
jvm 1 | System CPU(s): 2
jvm 1 | VM Max memory: 464 MB
jvm 1 |
jvm 1 | os.name: Linux
jvm 1 | os.arch: amd64
jvm 1 | os.version: 4.15.0-20-generic
jvm 1 | java.version: 1.6.0_11
jvm 1 | java.vendor: Sun Microsystems Inc.
jvm 1 | java.vendor.url: http://java.sun.com/
jvm 1 | java.vm.specification.version: 1.0
jvm 1 | java.vm.version: 11.0-b16
jvm 1 | java.vm.vendor: Sun Microsystems Inc.
jvm 1 | java.vm.name: Java HotSpot(TM) 64-Bit Server VM
Thanks
Re: problem with saving in database
Code: Select all
--- [ System Info ] ------------------------------------------
System CPU(s): 8
VM Max memory: 517 MB
os.name: Windows Vista
os.arch: x86
os.version: 6.2
java.version: 1.6.0_13
java.vendor: Sun Microsystems Inc.
java.vendor.url: http://java.sun.com/
java.vm.specification.version: 1.0
java.vm.version: 11.3-b02
java.vm.vendor: Sun Microsystems Inc.
java.vm.name: Java HotSpot(TM) Server VM
sfs pro take the arabic information from the database without any problem , because I can log in with an arabic username
but sfs send the arabic information as ??????????
I think I have to define the arabic language the "actionscript" file responsible for sending swears to the database?
Re: problem with saving in database
Hi,
if you can login with an arabic name, it means that the client is sending the correct characters, otherwise it would fail.
No, that's unlikely.
Can you show use the code you use to store the massages on the DB?
Thanks
if you can login with an arabic name, it means that the client is sending the correct characters, otherwise it would fail.
I think I have to define the arabic language the "actionscript" file responsible for sending swears to the database?
No, that's unlikely.
Can you show use the code you use to store the massages on the DB?
Thanks
Return to “SmartFoxServer 1.x Discussions and Help”
Who is online
Users browsing this forum: No registered users and 60 guests