cilveks Posted November 24, 2006 Report Share Posted November 24, 2006 (edited) http://paste.php.lv/4756 $title = 'Название'; (nevis kaa paste.php.lv noraadiits) lapas x.htm encodings ir <meta http-equiv="Content-Type" content="text/html; charset=windows-1251"> un es zinu ka tajaa lapaa ir tads teksts kaa - 'Название', ierakstot 'Название' vietaa kaadu citu vaardu, anglju valodaa, tad viss darbojas kaa naakas, znachit probleema ar enkodingiem. Savaa lapaa meegjinaaju visaadi mainiit kodeejumus, gan charset=windows-1251", gan charset=UTF-8", kaa arii meegjinaaju $title = iconv("windows-1251", "UTF-8", $title); un $title = iconv("UTF-8", "windows-1251", $title); vienalga bez rezultaatiem. Kaa pareizi jaaraksta, lai saliidzinaatu arii tekstus krievu valodaa? Un to ka kods ir neefektiivs, leens, to pats apzinos, un tas nav primaarais, primaarais ir lai kods vispaar darbojas kaa naakas. Edited November 24, 2006 by cilveks Link to comment Share on other sites More sharing options...
andrisp Posted November 24, 2006 Report Share Posted November 24, 2006 Kāda enkodingā tev ir pats skripts ? Link to comment Share on other sites More sharing options...
cilveks Posted November 24, 2006 Author Report Share Posted November 24, 2006 Ir meegjinaats gan - <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />, gan <meta http-equiv="Content-Type" content="text/html; charset=windows-1251"> Link to comment Share on other sites More sharing options...
andrisp Posted November 24, 2006 Report Share Posted November 24, 2006 Nē nē, kādā formatējumā tev ir pats skripta FAILS ? UTF-8 ? Link to comment Share on other sites More sharing options...
cilveks Posted November 24, 2006 Author Report Share Posted November 24, 2006 aa sapratu, jaa UTF-8 Link to comment Share on other sites More sharing options...
andrisp Posted November 24, 2006 Report Share Posted November 24, 2006 (edited) Varbūt sanāk: Pārkonviertierē to failu, ko pārsē, arī iekš utf-8 pirms lietošanas. Un izmanto preg_match ar u modifieri. (http://lv2.php.net/manual/en/reference.pcre.pattern.modifiers.php) PS. Īstenībā daudz labāk būs, ja izmantosi http://lv2.php.net/manual/en/function.mb-strpos.php Edited November 24, 2006 by andrisp Link to comment Share on other sites More sharing options...
cilveks Posted November 24, 2006 Author Report Share Posted November 24, 2006 Tas paliidzeeja, pasha faila paarkonverteeshana uz utf-8 pirms apstraades. Link to comment Share on other sites More sharing options...
Recommended Posts