mors Posted May 14, 2004 Report Posted May 14, 2004 man ir tabula ar referiem, no kuriem es gribu izvilkt ara mekletos vardus un tas it ka izdevas, bet ne parak patikami ir lasit sos %C4%81%C4%93%C4%8D utml. lv burtu vieta, tapec jautajums - ka sos konvertet uz āēč uc.? varbut ir kada php funkcija?
rnc Posted May 14, 2004 Report Posted May 14, 2004 Varbūt mēģini meklējamo vārdu pārkonvertēt šajos nesaprotamajos simbolos un meklēt :-)
bubu Posted May 14, 2004 Report Posted May 14, 2004 %CA noziimee, ka simbols ir ascii kodu 0xCA (hexdecimaalaa sisteemaa). so, paarveert katrus 2 simbolus aiz % ziimes, par vienu charakteri, un taa lieta ies!
rnc Posted May 14, 2004 Report Posted May 14, 2004 Tātad jūs domājat pirmais visus iekš DB esošos LV simbolus nesaprotamāja formā pārvērst uz saprotamo un tad meklēt ? Vai tas nav laikietilpīgāk kā uzreiz meklējamo vārdu pārveidot šajā nesaprotamajā formā un tad meklēt ?
mors Posted May 14, 2004 Author Report Posted May 14, 2004 te kads varbut kaut ko parprata ;) jo nekadu meklesanu man nevajag, vienkarsi stringa konvertesana, tagad to vajadzeja, lai izvaditu datus no tabulas, bet vispar turpmak si lieta tiks izmantota pirms datu ieliksanas tabula. atradu ari vajadzigo - http://lv.php.net/manual/en/function.rawurldecode.php
rumpels Posted May 18, 2004 Report Posted May 18, 2004 (edited) varbūt noder... <?php function cyrconvert($strings) { $specialchars = array( "ą" => "а", "į" => "б", "ā" => "в", "ć" => "г", "ä" => "д", "å" => "е", "ę" => "ж", "ē" => "з", "č" => "и", "é" => "й", "ź" => "к", "ė" => "л", "ģ" => "м", "ķ" => "н", "ī" => "о", "ļ" => "п", "š" => "р", "ń" => "с", "ņ" => "т", "ó" => "у", "ō" => "ф", "õ" => "х", "ö" => "ц", "÷" => "ч", "ų" => "ш", "ł" => "щ", "ś" => "ъ", "ū" => "ы", "ü" => "ь", "ż" => "э", "ž" => "ю", "˙" => "я", "ø" => "ё", "Ą" => "А", "Į" => "Б", "Ā" => "В", "Ć" => "Г", "Ä" => "Д", "Å" => "Е", "Ę" => "Ж", "Ē" => "З", "Č" => "И", "É" => "Й", "Ź" => "К", "Ė" => "Л", "Ģ" => "М", "Ķ" => "Н", "Ī" => "О", "Ļ" => "П", "Š" => "Р", "Ń" => "С", "Ņ" => "Т", "Ó" => "У", "Ō" => "Ф", "Õ" => "Х", "Ö" => "Ц", "×" => "Ч", "Ų" => "Ш", "Ł" => "Щ", "Ś" => "Ъ", "Ū" => "Ы", "Ü" => "Ь", "Ż" => "Э", "Ž" => "Ю", "ß" => "Я" ); $translate = strtr($strings, "", ""); $translate = strtr($translate, $specialchars); return $translate; } if (strcmp($action, "Mainīt tekstu")==0) { print "<b>konvertēts teksts:</b><br> ". cyrconvert($teksts); } ?> Edited May 18, 2004 by rumpels
GZZ Posted July 30, 2004 Report Posted July 30, 2004 Sveiki! Mēģinu uztaisīt lapeli WAP, problēmas ar formu nosūtīšanu latviešu valodā. Problēma ir tāda, ka āēč nav tas pats kas %C4%81%C4%93%C4%8D, ja izmanto urlencode funkcijas; šādu kaku postējot ražo wmlbrowser (kā plugins mozilla FF) un iespējams citi wml browseri - telefonos (Opera rāda pareizi, jeb pielāgojas manām kļūdām). āēč urlenkodēts būtu %E2%E7%E8, tas tiek automaģiski atkosts un nerada problēmas ar POST datiem, bet pirmā minētā versija neļauj korekti postēt lv tekstu! 1. Kā panākt, lai tiktu nosūtīts urlenkodēts teksts? vai 2. Kā efektīvi atkodēt šo kaku? Lapas kodējums windows-1257, mēģināts arī iso-8859-13, utf-8
GZZ Posted August 5, 2004 Report Posted August 5, 2004 Atrisināju visu lapu taisot utf-8 un pievienojot mb_internal_encoding("UTF-8").
Recommended Posts