Flex TextArea-从Word复制/粘贴-xml解析中的unicode字符无效



编辑:

请访问这里:

Flex text区域删除/替换无效小方块

似乎是个问题&需要找到解决方案。

原件:

我们有一个应用程序,用户可以在其中创建电子邮件消息&将其发送给不同的用户。我们将电子邮件创建为XML消息(发件人、目的地、主题、正文等)&把它放在队列里。

另一个应用程序接收消息,解析它&发送电子邮件。我们无法控制它。

现在的问题是在测试过程中,我们的测试人员从Word&使用了它。现在它可能有一些无效字符(在新行或选项卡上)在解析器中失败。错误为:

Invalid character in attribute value BODY (Unicode: 0x1A) 

所以现在我们需要防止发送这些无效的字符。所以我尝试使用textArea限制。creationComplete:上有这样的内容

contentTextArea.restrict = "A-Z a-z 0-9 .,!@#$%*-+[]{}()/' u2424\";

但不起作用。当我删除\u2424\时,它可能会起作用,但它会删除所有新行。那么我需要使用regex-replace吗?

如有任何帮助,我们将不胜感激。

尝试的文本是:

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.
 

该文本上有制表符/换行符等。

非常感谢

Harish

我能够通过使用textArea changeingHandler来处理它,只允许某些字符:

if (event.operation is PasteOperation)
{
event.preventDefault();
var txt:String = Clipboard.generalClipboard.getData(ClipboardFormats.TEXT_FORMAT).
toString().replace(/[^A-Za-z0-9s$%&*!@-_().]/ig, "");
......
}

相关内容

最新更新