note 105124 added to function.fwrite
| From: | shinkuchan69 at gmail dot com | Date: | Thu, 28 Jul 2011 21:40:04 +0000 |
| Subject: | note 105124 added to function.fwrite | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-181982@lists.php.net to get a copy of this message | ||
gracias Eugene Murai, y zaccraven por su aporte, realmente me fue de mucha ayuda el pasar el texto a
unicode.
primero tuve que cambiar el texto a utf8 con la función utfo8_encode ya que me suprimÃa las
letras con acentos, pero funcionó super.
$fd_o = fopen ($origen, "r");
// le damos la propiedad al archivo creado "W"
$fp_d = fopen($destino, "w+");
while (!feof($fd_o)) {
$buffer = fgets($fd_o, 4096);
$buffer = utf8_encode($buffer);
$buffer = chr(255).chr(254).mb_convert_encoding( $buffer, 'UTF-16LE',
'UTF-8');
fputs($fp_d, $buffer);
}
fclose ($fd_o);
fclose ($fd_d);
----
Server IP: 69.147.83.197
Probable Submitter: 163.247.80.18
----
Manual Page -- http://www.php.net/manual/en/function.fwrite.php
Edit -- https://master.php.net/note/edit/105124
Del: integrated -- https://master.php.net/note/delete/105124/integrated
Del: useless -- https://master.php.net/note/delete/105124/useless
Del: bad code -- https://master.php.net/note/delete/105124/bad+code
Del: spam -- https://master.php.net/note/delete/105124/spam
Del: non-english -- https://master.php.net/note/delete/105124/non-english
Del: in docs -- https://master.php.net/note/delete/105124/in+docs
Del: other reasons-- https://master.php.net/note/delete/105124
Reject -- https://master.php.net/note/reject/105124
Search -- https://master.php.net/manage/user-notes.php