Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

foreign character dilemma

Status
Not open for further replies.

richardko

Programmer
Jun 20, 2006
127
US
hi,
i am trying to grab some foreign character from an html page and insert it into a mysql database ...
For example say the character was chinese or russian,,,when i view it on a webpage it looks fine but when i try to pass it php script it converts to gibberish,,,what should i do to convert those characters to some utf-8 or some other mysql recongnizable format so that i can insert them into a mysql table?
Also i would want to convert them back to their original format when i view them on a webpage later on.
 
My web pages are either in French, English or Japanese and I don't have the problems you're describing.

My settings :

All PHP files in ANSI mode.

META
Code:
<meta http-equiv="content-type" content="text/html;charset=SHIFT-JIS">
OR
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">

MYSQL SERVER
Code:
default-character-set = latin1
character-set-server = latin1
collation-server = latin1_general_ci
init_connect = 'SET collation_connection = latin1_general_ci'
init_connect = 'SET NAMES latin1'

And check you Apache config too (httpd.conf)

 
thanks for the reply. it does work like you said.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top