Posted by Jon Hill on 04/28/05 16:19
> 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.
[Back to original message]
|