cyrillic in MySQL -
Kraeror - 14.12.2018
Hello guys!
Can you tell me please how to save cyrillic text in MySQL? I changed the collection to "cp1251_bulgarian_ci" but it still save bulgarian text "?? ??
?". What I have to do to save the text into my database?
Re: cyrillic in MySQL -
Kraeror - 14.12.2018
Any ideas?
Re: cyrillic in MySQL -
Kraeror - 14.12.2018
I tried to use this code:
PHP код:
mysql_set_charset("cp1251_bulgarian_ci");
mysql_tquery(MyMySQL, "SET NAMES `cp1251`", "", "");
mysql_tquery(MyMySQL, "SET CHARACTER SET `cp1251`","", "");
mysql_tquery(MyMySQL, "SET COLLATION_CONNECTION = `cp1251_bulgarian_ci`", "", "");
as in this topic the guy said!
BUT IT STILL DOESN'T WORK!
Re: cyrillic in MySQL -
Kraeror - 15.12.2018
Quote:
Originally Posted by ******
Don't use code pages, just stick to Unicode. However note that MySQL may have a strange non-standard Unicode version by default, you need "utf8mb4_unicode_ci" to get real Unicode in that case.
|
I changed that:
PHP код:
mysql_set_charset("utf8mb4_unicode_ci");
and I changed the collection in MySQL to "utf8mb4_unicode_ci" and now I have different output. It's something like this: "Íå ñëóøà"
Re: cyrillic in MySQL -
Kraeror - 15.12.2018
please help me guys
Re: cyrillic in MySQL -
Kraeror - 15.12.2018
There is it my MySQL insert into the database code:
PHP код:
mysql_format(MyMySQL, query, sizeof(query), "INSERT INTO `reports` (`DateTime`, `Sender`, `Receiver`, `Reason`) VALUES('%s', '%s', '%s', '%s')", tFormat, PlayerName(playerid), PlayerName(ID), REASON);
mysql_query(MyMySQL, query);
It is in my Gamemode:
PHP код:
mysql_set_charset("utf8mb4_unicode_c");
My structure:
https://imgur.com/a/ScZrYwI
My input as reason: "здравей"
and my output:
https://imgur.com/a/U0IB5jJ
Re: cyrillic in MySQL -
Kraeror - 15.12.2018
anybody?
Re: cyrillic in MySQL -
Kraeror - 15.12.2018
Please guys I really need help! +1 REP if you help me!!!!!
Re: cyrillic in MySQL -
Kraeror - 16.12.2018
Quote:
Originally Posted by ******
That really looks like you are mixing up code pages, like you are saving non-unicode text as unicode.
|
Please, help me. No one else can help me
Re: cyrillic in MySQL -
Y_Less - 16.12.2018
Quote:
Originally Posted by Y_Less
That really looks like you are mixing up code pages, like you are saving non-unicode text as unicode.
|
The data you are writing isn’t unicode, while the column is. You need to figure out what the data is and convert it.
Re: cyrillic in MySQL -
Kraeror - 17.12.2018
Quote:
Originally Posted by ******
The data you are writing isn’t unicode, while the column is. You need to figure out what the data is and convert it.
|
Where can I find it?
I read in the MySQL forums and people says that if I set the charset to "utf8" it will work, but it doesn't! What I have to do?
Re: cyrillic in MySQL -
Kaliber - 17.12.2018
I think your problem is, that you've already created the table with the wrong charset.
Can you look in PHPMyAdmin for example, what charset your column have?
Or change it directly to "utf8mb4_unicode_ci"
Re: cyrillic in MySQL -
Kraeror - 17.12.2018
Quote:
Originally Posted by Kaliber
I think your problem is, that you've already created the table with the wrong charset.
Can you look in PHPMyAdmin for example, what charset your column have?
Or change it directly to "utf8mb4_unicode_ci"
|
Take a look at it dude:
https://imgur.com/a/jLkOhlr
Re: cyrillic in MySQL -
Y_Less - 17.12.2018
Quote:
Originally Posted by Kraeror
Where can I find it? I read in the MySQL forums and people says that if I set the charset to “utf8” it will work, but it doesn’t! What I have to do?
|
Yes, as a general rule you should always use UTF-8. However, the problem is that while MySQL is set to unicode (which is good), the game isn’t. Thus you are mixing codepages, which requires conversion.
Re: cyrillic in MySQL -
Kraeror - 17.12.2018
Quote:
Originally Posted by Y_Less
Yes, as a general rule you should always use UTF-8. However, the problem is that while MySQL is set to unicode (which is good), the game isn’t. Thus you are mixing codepages, which requires conversion.
|
How and where can I convert it?
Re: cyrillic in MySQL -
Kraeror - 17.12.2018
Quote:
Originally Posted by Kaliber
I think your problem is, that you've already created the table with the wrong charset.
Can you look in PHPMyAdmin for example, what charset your column have?
Or change it directly to "utf8mb4_unicode_ci"
|
I recreated the table with "utf8mb64_unicode_ci" and it's still working!
Re: cyrillic in MySQL -
Kraeror - 17.12.2018
Any idea Y_Less?
Re: cyrillic in MySQL -
Infin1ty - 17.12.2018
Quote:
Originally Posted by Kraeror
Any idea Y_Less?
|
Relax, dude. You'll eventually get a response from somebody who's able to help.
Re: cyrillic in MySQL -
Kraeror - 19.12.2018
Quote:
Originally Posted by Infin1ty
Relax, dude. You'll eventually get a response from somebody who's able to help.
|
Third day dude... What can I do?
Re: cyrillic in MySQL -
Kraeror - 21.12.2018
anybody?