andrez Posted January 26, 2005 Report Posted January 26, 2005 piemeeram es notepadaa uztaisiiju failu un ieseivoju ar encoding UTF-8 uztaiisiju administaaciju caru php kas labo failu un laboto ieseivo. bet kad notiek ieseivoshana tad encodings paariet uz ANSI :/// KAA VAR IESEIVOT FAILUS UTF-8 ENCODINGAA shitaa var noradiit ka teksts ir tajaa encodingaa $text=utf8_encode($_POST["text"]); bet kaa lai uzliek ka pats fails ir utf-8 encodinga ? :/
blackhalt Posted January 26, 2005 Report Posted January 26, 2005 Tam php failam jāuzliek pareizi hīderi pašā augšā: <?php header('content-type: text/html; charset=utf-8'); ?>
Venom Posted January 27, 2005 Report Posted January 27, 2005 lapai, kur ievadforma, liec <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> tad $_POST pats tiks kod'ets uz utf-8
andrez Posted January 28, 2005 Author Report Posted January 28, 2005 taapataaas tteksta fails tiek ieseivots kaaa ANSI encodingaa !!! ://///////////
Venom Posted January 28, 2005 Report Posted January 28, 2005 nu tik muldies! <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"> </head> <body> <?php echo '<form action="'.$_SERVER['PHP_SELF'].'" method="post">'; ?> <textarea name="txt" cols="20" rows="6"></textarea> <input type="submit" value="spiezh" /></form> <?php if (isset($_POST['txt'])) { $fp=fopen('utf8.htm','w'); fwrite($fp,$_POST['txt']); fclose($fp); } @include_once 'utf8.htm'; ?> </body> </html>
andrez Posted January 28, 2005 Author Report Posted January 28, 2005 man vienkaarshi bij taa , taapeec negaaja :) <meta http-equiv="Content-Language" content="lv"> <meta http-equiv="content-type" content="text/html; charset=utf-8">
Recommended Posts