0

I am working with xmlSocket and I have an encoding problem (I think). In Flash Builder, when I trace my event.data property I see data as expected but when I debug it, I see many unrecognized characters.

See image :

enter image description here

image

When I use Alert.show() I see those unrecognized characters and when I work with substring methods and string methods, I have problem too.

Naturally, I want to work with the trace's version...

Encoding problem...? How to solve it ? I tried to work with byteArray without success.

NB: I can not modify or see the socket server code.

Thanks

Olivier J.
  • 3,115
  • 11
  • 48
  • 71

1 Answers1

0

Ok, my problem was just non-ascii characters. The following code solved me :

var myString:String = event.data.replace(/[^\x20-\x7E]/g, "")
Olivier J.
  • 3,115
  • 11
  • 48
  • 71