0

We have a php page inserting into mysql db. The problem all the tables in mysql we have been just using the default collation and character set as the latin1_swedish_ci. All have been working well where I can insert russian character and view it well. But I notice in the db is stored in this format the russian characters e.g ДоÑтавка груза. The issue now we also have java based backend system which reads from the db and read as this only ДоÑтавка груза ? So what is the resolution to this problem. I know is encoding issue.

3
Contributors
3
Replies
4
Views
4 Years
Discussion Span
Last Post by diafol
0

@newbie14

The issue now we also have java based backend system which reads from the db and read as this only ДоÑтавка груза ? So what is the resolution to this problem. I know is encoding issue

You can used:

mysql_set_charset ('utf8', $ this-> db);

or this:

mysql_query( "set names 'utf8'" ) ;

Then you need to modify mysql config(my.cnf)

[client]
default-character-set=utf8

[mysqld]
default-character-set=utf8

fixed that issue

0

lastmitch I have tried your option but is the same when I run my java app what I see on the terminal is still see something like this e.g.ДоÑтавка груза

0

Can't you change the charset/collation of the db/table directly? This would probably be the best way methinks. latin1_swedish_ci is all well and good, but as you've noticed, some chars get messed.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.