php and mysql database turkish character -
Hello friends, I know that this question is in StakeVareflow, but I look for answers to all the questions, but solutions for me No. My problem is mysql and php turkish character problem
I call it But the Turkish character is watching this: a ?? One ÃÆ'à ¢ â,¬Å¡Ãƒâ € šÃ, · ÃÆ'à ¢ â,¬Å¡Ãƒâ € šÃ, · ÃÆ'à ¢ â,¬Å¡Ãƒâ € šÃ, · p> I try the DB connection like this: But the Turkish character problem continues. Matching my phpmyadmin 3 tables matching: utf8_general_ci Message table matching: latin1_swedish_ci How can I resolve Turkish letter problem by screenshot links like this? HTML encoded entities in the database in your view mean that you are changing it by applying it to Unfortunately if your PHP version This multi-byte character Because the single-byte characters and HTML are encoded before saving. When you retrieve data from the database, you can use HTML entities in the HTML source code (ex: Look at the site's HTML source code and check whether there is any organization in the text from DB (Example: & lt; meta & gt;
& lt ;! DOCTYPE HTML Public "- // W3C // DTD XHTML 1.0 Transcriptional // N" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> & Lt; Html xmlns = "http://www.w3.org/1999/xhtml" & gt; & Lt; Top & gt; & Lt; meta http-equiv = "content-type" content = "text / html; charset = UTF-8" />
& lt ;? Php define ('DB_SERVER', 'localhost'); Define ('DB_USERNAME', 'root'); Define ('DB_PASSWORD', 'root'); Define ('DB_DATABASE', 'test'); Mysql_query ("SET NAMES UTF8"); $ Connection = mysql_connect (DB_SERVER, DB_USERNAME, DB_PASSWORD) or die (mysql_error ()); $ Database = mysql_select_db (DB_DATABASE) or die (mysql_error ()); ? & Gt;
& lt ;? Php $ wall = New Wall_Updates (); If (hasset ($ _ POST ['update'])) {$ update = mysql_real_escape_string ($ _ POST ['update']); $ Data = $ wall & gt; Insert_Update ($ ID, $ Update); If ($ data) {$ msg_id = $ data ['msg_id']; $ Message = tolink (htmlentities ($ data ['message'])); $ Time = $ data ['created']; $ Id = $ data ['uid_fk']; $ Name = $ data ['name']; $ Face = $ wall & gt; Gravatar ($ id); // $ commentsarray = $ wall & gt; Comments ($ msg_id); ? & Gt;
$ Ajax ({type: "POST", url: "(" # commentload "+ id) .append (html); $ (" # ctextarea "+ id) .val ('')" data "; $ (" # ctextarea "+ Id.) Focus ();}});} The description is false;});
htmlentities before saving your data in DB .
& lt; 5.4 optional parameter
$ encoding is passed to
UTF- 8 , it behaves like your string ASCII.
Multi-byte vs. Single-Byte:
& amp; ; Etthold; ), but your browser will present them to the way you are viewing them.
htmlentities should correct your problem and it is recommended or you can try to use
html_entity_decode before outputting the data (Not sure that this will not cause more trouble).
How to check HTML entities:
& Amp; atilde; ).
Comments
Post a Comment