title: Flex TextArea - copy/paste from Word - Invalid unicode characters on xml parsing
body: <p>EDIT:</p>
  
  <p>Please visit here:</p>
  
  <p><a href="https://stackoverflow.com/questions/13020958/flex-textarea-remove-replace-invalid-little-squares">Flex textArea remove/replace invalid little squares</a></p>
  
  <p>Seems to be the issue &amp; need to find a solution for this.</p>
  
  <p>ORIGINAL:</p>
  
  <p>We have an application where users can create an email message &amp; send it to different users. We create the email message as an XML message (sender, destination, subject, body, etc.) &amp; put it on the queue.</p>
  
  <p>Another application picks up the message, parses it &amp; sends out the emails. We have no control over it. </p>
  
  <p>Now the problem is during testing, our tester copied/paste some text from Word &amp; used it. Now that probably has some invalid characters (on new line or tab) that is failing in the parser. The error is :</p>
  
  <pre><code>Invalid character in attribute value BODY (Unicode: 0x1A) 
  </code></pre>
  
  <p>So now we need to prevent sending these invalid chars. So I tried using textArea restrict. Something like this on creationComplete:</p>
  
  <pre><code>contentTextArea.restrict = "A-Z a-z 0-9 .,!@#$%*-+[]{}()/' \u2424\\";
  </code></pre>
  
  <p>But does not work. When i remove \u2424\ it probably works, but it takes out all new lines. So do I need to use regex replace?</p>
  
  <p>Any help on this would be appreciated. </p>
  
  <p>The text tried was:</p>
  
  <pre><code>One area where the applications differ greatly is security.  Adding or removing a Permission within a Role does not require a deployment, simply a ‘data fix’.
  
  During development it was communicated that the audience of users .  As such there was no mechanism constructed to migrate between the two systems.  The purpose of this document is to outline two strategies for bring the user base between the two applications into sync.
   
  </code></pre>
  
  <p>There are tabs/new lines, etc. on this text.</p>
  
  <p>Thanks so much</p>
  
  <p>Harish</p>