Raised This Month: $ Target: $400
 0% 

mysql utf8 encoding


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
aaarnas
Veteran Member
Join Date: Jun 2008
Location: Lithuania
Old 08-16-2012 , 17:20   mysql utf8 encoding
Reply With Quote #1

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 ?
__________________
My plugins:
[ZP] ZM_VIP (v2.0.0 is comming. v1.9.1 BETA is out!)

aaarnas is offline
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 08-16-2012 , 18:18   Re: mysql utf8 encoding
Reply With Quote #2

Not sure if that makes sense, but did you try encoding the .sma to UTF-8 without BOM?
hleV is offline
SpaceRip
Junior Member
Join Date: Aug 2012
Old 08-17-2012 , 06:30   Re: mysql utf8 encoding
Reply With Quote #3

Quote:
Originally Posted by hleV View Post
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.
SpaceRip is offline
matsi
Thinkosaur
Join Date: Sep 2006
Old 08-17-2012 , 07:16   Re: mysql utf8 encoding
Reply With Quote #4

Quote:
Originally Posted by aaarnas View Post
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?
matsi is offline
Backstabnoob
BANNED
Join Date: Feb 2009
Location: Iwotadai Dorm
Old 08-17-2012 , 07:49   Re: mysql utf8 encoding
Reply With Quote #5

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.
Backstabnoob is offline
matsi
Thinkosaur
Join Date: Sep 2006
Old 08-17-2012 , 08:20   Re: mysql utf8 encoding
Reply With Quote #6

Quote:
Originally Posted by Backstabnoob View Post
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.
matsi is offline
aaarnas
Veteran Member
Join Date: Jun 2008
Location: Lithuania
Old 08-17-2012 , 09:44   Re: mysql utf8 encoding
Reply With Quote #7

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
Now I would need to read all this: http://en.wikipedia.org/wiki/UTF-8
__________________
My plugins:
[ZP] ZM_VIP (v2.0.0 is comming. v1.9.1 BETA is out!)

aaarnas is offline
Backstabnoob
BANNED
Join Date: Feb 2009
Location: Iwotadai Dorm
Old 08-17-2012 , 09:48   Re: mysql utf8 encoding
Reply With Quote #8

Read my post again.
Backstabnoob is offline
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

Forum Jump


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


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