Ugga Posted January 13, 2008 Report Share Posted January 13, 2008 Tātad uzliku sev phpMyAdmin jaunāko versiju, izveidoju db un tabulu. datubāzei,mysql,tabulai,laukiem - visam ir uzlikts UTF-8. HTML'ā arī pie encoding ir uzlikts UTF-8 un visi faili arī ir saglabāti UTF-8, bet kādēļ man vēljoprojām ir "?" zīmes garumzīmju un mīkstinājumu vietā? Paldies. Link to comment Share on other sites More sharing options...
Val Posted January 13, 2008 Report Share Posted January 13, 2008 http://php.lv/f/index.php?showtopic=7855#entry64376 Link to comment Share on other sites More sharing options...
Ugga Posted January 13, 2008 Author Report Share Posted January 13, 2008 Paldies, pārbaudīšu - Bet vienalga kaut kā stulbi - ja visur ir kopīgs Encoding's un problēma saglabājas. Link to comment Share on other sites More sharing options...
Ugga Posted January 13, 2008 Author Report Share Posted January 13, 2008 Cik sapratu, tad mysql_query("SET NAMES 'UTF-8'"); mysql_query("SET CHARACTER SET utf-8"); ir jāliek visur, kur es veidoju jaunu pieslēgšanos datubāzei vai pirms/pēc pieprasījumiem, vai kā? Link to comment Share on other sites More sharing options...
Val Posted January 13, 2008 Report Share Posted January 13, 2008 1. variants Link to comment Share on other sites More sharing options...
Ugga Posted January 13, 2008 Author Report Share Posted January 13, 2008 Nu, ko lai saka. Uzliku šādi: <?php $link = mysql_connect($host, $username, $password); if (!$link) { die('Kļūda pieslēdzoties datubāzei ' . mysql_error()); } mysql_query("SET NAMES 'UTF-8'"); mysql_query("SET CHARACTER SET 'UTF-8'"); mysql_select_db($database); ?> NEIET. Vienalga neiet. Visur, kur var ir UTF-8 Link to comment Share on other sites More sharing options...
mounkuls Posted January 13, 2008 Report Share Posted January 13, 2008 header("Content type:text/html; charset=utf-8"); ar? Link to comment Share on other sites More sharing options...
Ugga Posted January 13, 2008 Author Report Share Posted January 13, 2008 header("Content type:text/html; charset=utf-8"); ar? Diemžēl ne. Rīt iepostošu visus savus parametrus un koda fragmentus - cerams, ka kāds varēs palīdzēt. Link to comment Share on other sites More sharing options...
mounkuls Posted January 13, 2008 Report Share Posted January 13, 2008 Oj! aizmirsu paprasīt kur rāda tos"?" ? phpMyAdmin vai pašā lapā? Link to comment Share on other sites More sharing options...
Lynx Posted January 14, 2008 Report Share Posted January 14, 2008 (edited) Šodien paspēlējos ar savu mysql serveri. Ja visiem projektiem uz mysql ir defaultā vajadzīgs utf-8, varam mierīgi pievienot šīs divas rindas [mysqld] sadaļā konfigurācijas failā un restartēt mysql. default-character-set=utf8 skip-character-set-client-handshake Tas atrisina to, ka nav vairāk nepieciešams pirmo kveriju sūtīt: SET NAMES utf8 Hmm, teorētiski, vai nevajadzētu arī būt pat ļoti maziņam performance gainam? Edited January 14, 2008 by Lynx Link to comment Share on other sites More sharing options...
andrisp Posted January 14, 2008 Report Share Posted January 14, 2008 (edited) Teorētiski droši vien. Vispār iesaku kārtīgi izstudēt šo: http://dev.mysql.com/doc/refman/5.0/en/cha...connection.html Un kas vēl, ja nemaldos, tad set names ir jāsūta pēc tam kad ir izvēlēta datubāze. Un tas set charset nav vajadzīgs. Par to kāda atšķirība, arī var izlasīt tajā linkā. Edited January 14, 2008 by andrisp Link to comment Share on other sites More sharing options...
Recommended Posts