Mikijs Posted February 19, 2008 Report Share Posted February 19, 2008 Es piemēram reģistrējos un manis ievadīto elementu saglabā pgsql datubāzē. id | name | email 1 | Māris | maris@maris.lv Tagad dodos uz webu lai apskatītu rezūltātu, bet ko es tur ieraugu MÄris < maris@maris.lv > vai ir kāda iespēja to ķēmu dabūt nost? (charset: utf-8) Link to comment Share on other sites More sharing options...
Aleksejs Posted February 19, 2008 Report Share Posted February 19, 2008 Neizskatās, ka būtu utf-8 Postgre droši vien ir kāds analogs mysqliskajam: SET NAMES ... Link to comment Share on other sites More sharing options...
Mikijs Posted February 19, 2008 Author Report Share Posted February 19, 2008 postgree viss kartiba jo tur rada garumzimi nju man shema ir tada es esmu MAIN lapa un lapa ir ieklauta velviena lapa (iframe) main lapas header <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!-- [url="http://www.c4.lv"]http://www.c4.lv[/url] --> <html lang="en-US"><head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title>Mail :: Kontakti</title> .. seit nedauzd javascripti </head> Iframe headers <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd"> <!-- [url="http://www.c4.lv"]http://www.c4.lv[/url] --> <html lang="en-US"><head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title>Address Book</title> </head> itkaa tas pats =/ + man ieksh iframe no koda puses vel ir ievadits <?php global $language; if (isset($language)) { header('Content-type: text/html; charset=' . NLS::getCharset()); header('Vary: Accept-Language'); } ?> Link to comment Share on other sites More sharing options...
andrisp Posted February 19, 2008 Report Share Posted February 19, 2008 Un točna zini, ka NLS::getCharset() ir utf8 ? Nospied uz tā iframe ar labo pogu un paskaties View Page Info (ja izmanto Firefox) un tur varēsi redzēt kādu tad reāli pārlūks charsetu izmanto, lai parādītu lapu. Link to comment Share on other sites More sharing options...
Mikijs Posted February 19, 2008 Author Report Share Posted February 19, 2008 encoding: UTF-8 Link to comment Share on other sites More sharing options...
andrisp Posted February 19, 2008 Report Share Posted February 19, 2008 Tad visticamāk, ka dati datubāzē nav utf-8 vai arī pārsūtot no datubāzes uz web serveri tiek veikta kaut kāda konvertācija. Link to comment Share on other sites More sharing options...
Mikijs Posted February 19, 2008 Author Report Share Posted February 19, 2008 itka man uzrada datubaze garumzimi bet n nu jaa.. ka parbaudit kads shifrejums db? Link to comment Share on other sites More sharing options...
andrisp Posted February 19, 2008 Report Share Posted February 19, 2008 itka man uzrada datubaze garumzimi bet n nu jaa.. Tas jau nenozīmē, ka dati ur utf8 uzreiz. Varbūt pamēģini iekš HTML headeriem ielikt windows-1257 un paskaties vai nesāk rādīt pareizi. Link to comment Share on other sites More sharing options...
marcis Posted February 19, 2008 Report Share Posted February 19, 2008 Ja tev būtu datubāzē utf-8, tad tur tu redzētu Ä un pie izvades ā. Link to comment Share on other sites More sharing options...
Klez Posted February 19, 2008 Report Share Posted February 19, 2008 (edited) pasham failam ir utf-8 ? tas ka <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> ir tas vareetu buut par maz ... izlasi shos topikus ... http://php.lv/f/index.php?showtopic=5503 http://php.lv/f/index.php?showtopic=9295 notepad2 = file > encoding > utf-8 Edited February 19, 2008 by Klez Link to comment Share on other sites More sharing options...
marcis Posted February 19, 2008 Report Share Posted February 19, 2008 (edited) Klez, velkot ārā no datubāzes, teorētiski, nav svarīgi kāds ir faila čarsets, ja kods tiek renderēts utf-8. Edit: uzlabota posta saprotamība Edited February 19, 2008 by marcis Link to comment Share on other sites More sharing options...
Aleksejs Posted February 19, 2008 Report Share Posted February 19, 2008 Tur jau tā lieta, ka ja pats fails nav UTF-8, tad arī renderēts iekš UTF-8 nekas netiks. Link to comment Share on other sites More sharing options...
andrisp Posted February 19, 2008 Report Share Posted February 19, 2008 Nē, skripti var nebūt utf-8. Ja HTML kodā ir meta tags ar utf-8 un/vai arī iekš HTTP content-type headera ir norādīts utf-8, un paši no dati no db tiek ņemti utf-8 formātā, tad pārlūkam tos arī jārāda kā utf-8. Pārlūkam nospļauties par pārējo simbolu formātu. Link to comment Share on other sites More sharing options...
Aleksejs Posted February 19, 2008 Report Share Posted February 19, 2008 Ja es izvadīšu no datubāzes dabūtu lauku no faila, kas saglabāts, kā ne UTF-8, bet gan teiksim windows-1257 $mainigais = korektaa_no_DB_utf8_ielasoshaa_funkcija(); echo 'glāžšķūņrūķīši'$mainigais; vai tiešām mani glāžšķūņrūķīši rādīsies pareizi? Un ja tie rādīsies, tad vai tiešām rādīsies pareizi tie latviešu burti, kas ielasīti no DB? Link to comment Share on other sites More sharing options...
andrisp Posted February 19, 2008 Report Share Posted February 19, 2008 Ja tu nosūtīsi kā utf-8 (norādot ar html meta vai http content-type), tad šķūnīši rādīsies nepareizi, bet no db ņemtais utf-8 teksts pareizi. Link to comment Share on other sites More sharing options...
Recommended Posts