malinens Posted June 21, 2011 Report Share Posted June 21, 2011 Klasiska situācija: vecas windows-1257 lapas ar Windows-1251 html entities. Kā automātiski pārvērst uz normālu utf-8? Paldies! Quote Link to comment Share on other sites More sharing options...
mickys Posted June 21, 2011 Report Share Posted June 21, 2011 varbūt htmlentities() var to paveikt? Quote Link to comment Share on other sites More sharing options...
daGrevis Posted June 21, 2011 Report Share Posted June 21, 2011 iConv(). Quote Link to comment Share on other sites More sharing options...
malinens Posted June 21, 2011 Author Report Share Posted June 21, 2011 bet konvertēt var jau tikai vienu kodējumu, bet lapā ir 2 kodējumu mikslis. Quote Link to comment Share on other sites More sharing options...
rpr Posted June 21, 2011 Report Share Posted June 21, 2011 iConv(). ar iconv entities nepārkovertēsi. varbūt līdz html_entity_decode() Quote Link to comment Share on other sites More sharing options...
malinens Posted June 21, 2011 Author Report Share Posted June 21, 2011 nu es varu lietot html_entity_decode, bet vienalga vienlaicīgi var lietot tikai vienu kodējumu un, ja dokumentam uzliks windows-1257 kodējumu, tad tikai LV simboli pareizi rādīsies un otrādi. Quote Link to comment Share on other sites More sharing options...
mounkuls Posted June 21, 2011 Report Share Posted June 21, 2011 (edited) Varbūt parādi lapu, kur ir tā. Parasti ir vai nu viens vai otrs kodējums vienā html dokumentā. Ja domāts ar to bija dažādos html, tad sākumā noskaidro kāds ir encoding un attiecīgi arī konvertē. Ja vispār sapratu ko gribi protams? P.S. Tas tā no vienas puses. Ja baigi gribi, tad saraksti funkciju ar repleisiem un miers, krievu entities kods atšķiras tā pat no latviešu. Edited June 21, 2011 by mounkuls Quote Link to comment Share on other sites More sharing options...
malinens Posted June 21, 2011 Author Report Share Posted June 21, 2011 Darīšu laikam tā: No sākuma konvertēšu visu uz utf-8 un tad ar šo: http://www.phpclasses.org/package/4968-PHP-Convert-Russian-UTF-8-text-to-HTML-entities.html krieviskās entītijas pārkonvertēšu uz utf-8. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.