Re: Is it possible to save a file with UTF-8 encoding and noBOM using PHP?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> 1. First I want to know how to make the actual binary file that is written,
> to be encoded as UTF-8. This is my PRIMARY question.
I think this part is the key. If the string originated from your text editor, 
then your text editor needs to be in UTF-8 mode. If you are importing the 
data from a file or database then you need to be sure that the data is UTF-8  
encoded. If you know that the encoding is instead ISO-8859-1 then you can 
convert it to UTF-8 with the php function utf_encode. fwrite will then write 
out the bytes that you presented to it. I guess the same applies in reverse 
when you read the file back in to the application that will view the text.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux