I’ve ran into a problem using the built in functions in editManager (flashx.textLayout.edit.IEditManager) where it is killing/removing/deleting special characters in a String when I use the function overwriteText() or insertText()
Here is an example function below (where textFlow is already set up elsewhere):
private var editManager:IEditManager;
textFlow.interactionManager = editManager;
private function updateText(myText:String):void {
editManager.selectAll();
editManager.overwriteText( myText );
}
If I try to use a special character, for example bullet dot. “•” it just removes it, while keeping most other text. Trying to add the escaped value just causes the full escaped code to appear in the text: “&# x2022;” (space added before “x” or else that shows as the bullet on this forum). Special angled quotes and apostrophes also get killed.
So, if myText = “Some special • characters ‘ ’ “ ”get removed!”;
what I end up seeing in my TLF looks like: “Some special characters get removed!”
And yes, those characters are supported by the embedded font I am using, in fact they show up fine if you do something like textFlow = TextConverter.importToFlow(value, TextConverter.TEXT_LAYOUT_FORMAT, config);
However, I want to update the text content only, and not lose the format/style of the textFlow, which is in a custom state. The editManager functions seem to work well for this, I just am surprised that they are removing the special characters. If anyone has a fix for this or suggestions please reply, thanks.
Also of note, most characters you can enter with shift on the keyboard do appear just fine such as ~!@#$%^&*(){} etc. it just seems to have problems with characters in a certain range, the kind you’d use Alt+ to make such as ƒ (Alt+159) the others I mentioned, and so on. Of course if the font doesn’t support certain characters it causes other issues, but I’m talking about characters that the font does support being removed.