Thanks Clint for your suggestion but this approach doesn't work either. Tried 
using every way I know how to assign the content to the RichText control. It 
could still be my error on how I'm assigning content to the TLF document.

There must be some way to make this work since on can supposedly display Kanji 
characters in this way if the app is localized. The internals must be there for 
displaying multi-byte and/or unicode somewhere. Guess I'll resort to diving 
into RichText code and see what I can find.

Thanks again.

Erik

> On Apr 17, 2017, at 3:28 PM, Clint M <[email protected]> wrote:
> 
> maybe this?
> http://stackoverflow.com/questions/37192684/stagetext-and-emoji-on-android-air-mobile-as3
>  
> <http://stackoverflow.com/questions/37192684/stagetext-and-emoji-on-android-air-mobile-as3>
> txt2.text = decodeURI(txt1.text);
> 
> On Mon, Apr 17, 2017 at 3:22 PM, Erik J. Thomas <[email protected] 
> <mailto:[email protected]>> wrote:
> Hey all:
> 
> Do you have any idea how I can display this Unicode character U+1F601 
> <https://apps.timwhitlock.info/unicode/inspect/hex/1F601> or these UTF-8 
> Bytes \xF0\x9F\x98\x81 using TLF (in RichEdit control)?
> 
> Thanks!
> 
> Erik
> 
> For additional background on my problem, read on...
> 
> I'm implementing a mobile social media feed display using TLF (spark 
> RichText) to display inline emoji. The user enters a short message into a 
> TextInput control on the phone, and using the soft keyboard selects emoji 
> keyboard, selects an emoji to display with the text and posts their update.
> 
> Getting the text from the user works fine and the emoji is represented as UTF 
> or Unicode value though I don't know how to verify.
> 
> The TextInput control on the device shows the emoji rendering perfectly 
> (spark TextInput):
> 
> 
> 
> The value in the IntelliJ debugger's Variables view also renders the Unicode 
> or UTF bytes correctly:
> 
> 
> 
> But when I attempt to set the contents of the RichText control with the 
> contents of the input field, the emoji is lost:
> 
> 
> 
> I have tried many approaches, some are:
> var value:String = textInput.text; // this contains the emoji:
> richEditControl.text = value;
> 
> richEditControl.textFlow = TextFlowUtil.importFromString(value);
> 
> richEditControl.textFlow = TextConverter.importToFlow(value, 
> TextConverter.TEXT_FIELD_HTML_FORMAT);
> 
> richEditControl.textFlow = TextConverter.importToFlow(value, 
> TextConverter.PLAIN_TEXT_FORMAT);
> They each fail to display the emoji. I can display complex content in the 
> same control no problem and I'm pretty familiar with TLF:
> 
> 
> 
> I want to deal with HTML markup and TextConverter rather than composing the 
> TLF in code, but if I have to go that route, I'm willing to if it works.
> 
> But getting the RichText control's TextFlow to display a UNICODE character is 
> a mystery to me and googling for answers has not been fruitful.
> 
> I understand there is some question of whether Android phones will display 
> the equivalent emoji as on iPhone, I get that. But looking at this chart, it 
> should be possible for the most part:
> 
> https://apps.timwhitlock.info/emoji/tables/unicode 
> <https://apps.timwhitlock.info/emoji/tables/unicode>
> 
> My problem should be a simple as just learning how to display this Unicode 
> character U+1F601 <https://apps.timwhitlock.info/unicode/inspect/hex/1F601> 
> or these UTF-8 Bytes \xF0\x9F\x98\x81 using TLF. Is it possible? Thanks! Erik
> 
> 
> 

Reply via email to