UTF8 Encoding on different machines

A

alomrani

Hi All,

I'd really appreciate anyone's insight over here . Since I am trying to
resolve this problem for the past two weeks.

Machine 1: I have a java web application running on Tomcat , MySQL on
one machine with UTF8 encoding showing perfectly on the web client.

Machine 2: I tried to install this application on the server machine
now .. all from fresh like I did on machine 1, installed MySQL, Tomcat
, etc. However, when I run the application the encoding is not properly
displayed. It would show the correct language but the characters are
altered and messy.

I tried on a different machine but still the same . I cant rely on
Machine 1 , and all versions running are the same.

Both machines are win xp pro, MySQL 5.0, java connector 3.2.0 alpha,
Tomcat 5.0.27.

Thanks All
 
S

Soren Kuula

Hi All,

I'd really appreciate anyone's insight over here . Since I am trying to
resolve this problem for the past two weeks.
Both machines are win xp pro, MySQL 5.0, java connector 3.2.0 alpha,
Tomcat 5.0.27.

Hi,

Defaults are evil. They hide in your system, and conspire to ruin your
day. Never trust a default.

So, what are the operating systems on the 2 machines? Can you say
anything about default character encoding on them? ( I think you can
write a small Java program, that gets that from the System class. See
documentation).

On Machine 2, does static content on pages (that never has seen the
database) also go bad, or is it only data from the database?

Either,

- your java listens to the system default encoding somewhere (it never
should; defaults are evil), and it is different in to two machines

or

- the database does the same

or

- both

or

- you use Tomcat through web servers on the two machines, and the web
servers add HTTP headers with encoding (dis)information (try to access
Tomcat directly)

or

- You have migrated database data from server 1 to server 2, and messed
up there.

Søren
 
A

alomrani

Thanks Soren for pointing out that.

I did a system parameter check ..
The only difference was in Mysql character set and collation ! eurika..


After running :
show variables like 'character_set%'


Machine 1:
character_set_client latin1
character_set_connection utf8
character_set_database utf8
character_set_filesystem binary
character_set_results latin
character_set_server utf8
character_set_system utf8
character_sets_dir C:\Program Files\MySQL\MySQL Server
5.0\share\charsets\

Machine 2:
character_set_client utf8
character_set_connection utf8
character_set_database utf8
character_set_filesystem binary
character_set_results utf8
character_set_server utf8
character_set_system utf8
character_sets_dir C:\Program Files\MySQL\MySQL Server
5.0\share\charsets\
==============================
BUT :
When I run this it sets it temporarily

set character_set_client='latin1';
set character_set_results='latin1';

And when I try to display the variables again they are still the same (
unchanged )

------------------------------------

You pinpointed also that there could be a problem while migrating the
database. I checked that they are the same !

All collation variables where different now both machines are the same.

I am going crazy now.. not knowing what to do.

I am running windows XP on both machines.
 
A

alomrani

resolved



Thanks Soren for pointing out that.

I did a system parameter check ..
The only difference was in Mysql character set and collation ! eurika..


After running :
show variables like 'character_set%'


Machine 1:
character_set_client latin1
character_set_connection utf8
character_set_database utf8
character_set_filesystem binary
character_set_results latin
character_set_server utf8
character_set_system utf8
character_sets_dir C:\Program Files\MySQL\MySQL Server
5.0\share\charsets\

Machine 2:
character_set_client utf8
character_set_connection utf8
character_set_database utf8
character_set_filesystem binary
character_set_results utf8
character_set_server utf8
character_set_system utf8
character_sets_dir C:\Program Files\MySQL\MySQL Server
5.0\share\charsets\
==============================
BUT :
When I run this it sets it temporarily

set character_set_client='latin1';
set character_set_results='latin1';

And when I try to display the variables again they are still the same (
unchanged )

------------------------------------

You pinpointed also that there could be a problem while migrating the
database. I checked that they are the same !

All collation variables where different now both machines are the same.

I am going crazy now.. not knowing what to do.

I am running windows XP on both machines.
 
T

Tom Cole

That's it? resolved? What about the poor guy who has the same problem 3
years from now and comes across this thread?

resolved.

That's gonna help him/her out a lot. Glad to see you got something out
of it though.
 
S

Soren Kuula

Tom said:
That's it? resolved? What about the poor guy who has the same problem 3
years from now and comes across this thread?

Hi,

Yeah, tell us what you did?

In fact I have a MySQL character encoding problem too (too lazy to fight
with it). Tell us what you did with that database please.

Søren
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,812
Latest member
GracielaWa

Latest Threads

Top