I was almost certainly wrong about the BOM thing.
The docs say :

writeUTF () method   

public function writeUTF(value:String):void 

Writes a UTF-8 string to the file stream, byte stream, or byte array. The 
length of the UTF-8 string in bytes is written first, as a 16-bit integer, 
followed by the bytes representing the characters of the string. 

So I think those chars you see at the beginning are the length information from 
using writeUTF().

Try using writeUTFBytes() instead?


-----Original Message-----
From: [email protected] on behalf of Jim Hayes
Sent: Tue 28/10/2008 21:06
To: [email protected]
Subject: RE: [flexcoders] AIR write file - prepended with irregular character
 
I've seen this. I think it's maybe a BOM (Byte Order Marker ????).
Something that more technical people than myself know about,if I'm even correct 
about that. I may not be.

There are two ways to write the text from AIR(writeUTFBytes ???? and errrr the 
other one, sorry to be vague, I might not even have the first one correct)
Use the other one from that which you are using (at least, that's what I did to 
avoid this problem).
I'm away from my normal PC at the moment, or I could give you a proper answer, 
sorry about that.

-----Original Message-----
From: [email protected] <mailto:flexcoders%40yahoogroups.com>  on 
behalf of Ben Marchbanks
Sent: Tue 28/10/2008 19:11
To: [email protected] <mailto:flexcoders%40yahoogroups.com> 
Subject: [flexcoders] AIR write file - prepended with irregular character

I am creating XML files to File.applicationStorageDirectory and the
file gets created without error.

Unfortunately there is an irregular character at the beginning of the
file contents which does not exist in the XML.

How can I prevent this ?

ò<OpenShipments xmlns="x-schema:OpenShipments.xdr">

should be
<OpenShipments xmlns="x-schema:OpenShipments.xdr">

__________________________________________________________
This communication is from Primal Pictures Ltd., a company registered in 
England and Wales with registration No. 02622298 and registered office: 4th 
Floor, Tennyson House, 159-165 Great Portland Street, London, W1W 5PA, UK. VAT 
registration No. 648874577.

This e-mail is confidential and may be privileged. It may be read, copied and 
used only by the intended recipient. If you have received it in error, please 
contact the sender immediately by return e-mail or by telephoning +44(0)20 7637 
1010. Please then delete the e-mail and do not disclose its contents to any 
person.
This email has been scanned for Primal Pictures by the MessageLabs Email 
Security System.
__________________________________________________________

 


______________________________________________________________________
This communication is from Primal Pictures Ltd., a company registered in 
England and Wales with registration No. 02622298 and registered office: 4th 
Floor, Tennyson House, 159-165 Great Portland Street, London, W1W 5PA, UK. VAT 
registration No. 648874577.

This e-mail is confidential and may be privileged. It may be read, copied and 
used only by the intended recipient. If you have received it in error, please 
contact the sender immediately by return e-mail or by telephoning +44(0)20 7637 
1010. Please then delete the e-mail and do not disclose its contents to any 
person.
This email has been scanned for Primal Pictures by the MessageLabs Email 
Security System.
______________________________________________________________________

<<winmail.dat>>

Reply via email to