This content has been marked as final. Show 3 replies
ActionScript strings are 2-byte Unicode strings. I expect this means UCS-2 encoding rather than UTF-16, though I haven't actually seen that in the documentation.
UTF-8 is different from both of these encodings. So, yes, you do need to convert the UCS-2/UTF-16 data to UTF-8. You can do that with flash.utils.ByteArray. It has a method writeUTFBytes(). You can then read the encoded data out of the ByteArray and send it to the DB server.
Thanks, jkhgdkhgslkj. But I still don't know how to do it. Let's say I have a variable str:String which stores some non-English characters. Do you mean I use bytearray.writeUTFBytes to convert it to a ByteArray? Then how can I send this ByteArray variable to mysql?
I think I find a solution. The solution is not on actionscript part but on the server side (php). I used amfphp to do mysql database operations and when I set
I find the following article useful: