AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   mysql utf8 encoding (https://forums.alliedmods.net/showthread.php?t=193122)

aaarnas 08-16-2012 17:20

mysql utf8 encoding
 
Hi,

I came up with one encoding problem, so maybe anyone could give ideas.

On mysql database I saved records with special characters. Collation is utf8_lithuanian_ci.
Everything is fine, but the problem is - when i getting utf8 text from database, counter strike can't show special symbols. It shows spaces or question marks.
As we know, CS is able to show utf8 symbols from multi-langual. So how to show them from mysql?
I would need to encode text directly or something ?

hleV 08-16-2012 18:18

Re: mysql utf8 encoding
 
Not sure if that makes sense, but did you try encoding the .sma to UTF-8 without BOM?

SpaceRip 08-17-2012 06:30

Re: mysql utf8 encoding
 
Quote:

Originally Posted by hleV (Post 1773347)
Not sure if that makes sense, but did you try encoding the .sma to UTF-8 without BOM?

it wont change anything.

There are still somethings what cs cant show, because they did not put that "unicode" image in game.

matsi 08-17-2012 07:16

Re: mysql utf8 encoding
 
Quote:

Originally Posted by aaarnas (Post 1773310)
Hi,

I came up with one encoding problem, so maybe anyone could give ideas.

On mysql database I saved records with special characters. Collation is utf8_lithuanian_ci.
Everything is fine, but the problem is - when i getting utf8 text from database, counter strike can't show special symbols. It shows spaces or question marks.
As we know, CS is able to show utf8 symbols from multi-langual. So how to show them from mysql?
I would need to encode text directly or something ?

What kind of special characters you saved?

Backstabnoob 08-17-2012 07:49

Re: mysql utf8 encoding
 
You cannot show certain symbols in the game and there is no workaround for that. Save the text directly without them to the SQL database or replace the special characters before showing them.

matsi 08-17-2012 08:20

Re: mysql utf8 encoding
 
Quote:

Originally Posted by Backstabnoob (Post 1773831)
You cannot show certain symbols in the game and there is no workaround for that. Save the text directly without them to the SQL database or replace the special characters before showing them.

Yeah, thats why i asked him what he saved there. If it was something the game can't display. :shock:

aaarnas 08-17-2012 09:44

Re: mysql utf8 encoding
 
It's Lithuanian letters ąčęėįšųūž. Cs can show it with utf8 without BOM from multi-langual.
As I know, mysql also not use BOM. It's just a simple text saved in database.

Tried "SET NAMES utf8", but it doesn't change anything (it helps getting strings in utf8 format).
It is possible to convert from one encoding to other through bits, but I missed that lesson in studies. What a shame :shock:
Now I would need to read all this: http://en.wikipedia.org/wiki/UTF-8 :(

Backstabnoob 08-17-2012 09:48

Re: mysql utf8 encoding
 
Read my post again.


All times are GMT -4. The time now is 05:49.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.