Yeah, that worked thanks! I had tried what you did, but it did not
work with the UTF-32 data. Do you know why? And how do you suppose my
data was turned into UTF-32. I got the data originally from an HTTP
GET request that returned a UTF-8 encoded XML file. The file its self
says it's UTF-8, and the header tuple said the document was using the
UTF-8 charset. Does Erlang convert the data automatically?<div>
<br></div><div>Thanks!</div><font color="#888888">-Dustin</font><br><br><div class="gmail_quote">On Feb 12, 2008 2:59 AM, Hasan Veldstra <<a href="mailto:hasan.veldstra@gmail.com">hasan.veldstra@gmail.com</a>> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="Ih2E3d"><br>> How can I write [332,116,97,44,32,71,117,110,109,97] to a file so<br>
> that when I open it up it looks like "Ôta, Gunma"?<br><br><br></div>-module(ftest).<br>-export([run/0]).<br><br>run() -><br> Data = [197,140,116,97,44,32,71,117,110,109,97],<br> file:write_file("ftest.txt", list_to_binary(Data)).<br>
<br><br>Text is just numbers when stored to disk.<br><br>By the way, the list of numbers you originally posted is "Ôta, Gunma"<br>encoded in UTF-32, not UTF-8. It's in UTF-8 in my example.<br><br>Hope this helps.</blockquote>
</div><br>