Hey Clint:

>> "this most likely won't work on android (or windows) as they don't have 
>> access to the apple emoji font"

Yeah, but I can't even get it to work from one control to another on the same 
platform (iPhone) in the same Flex mobile app, using the same fonts. So yeah, 
probably won't work on Android if it won't work anywhere at all. But I thought 
if I could learn to simply display an embedded UNICODE character in a Flex 
display control, that I might at least make this work on iOS and I could find 
some other way to convert from UNICODE to fontAwesome chars or something like 
that on Android.

Anyway, just surprised I can't display UNICODE chars in RichText.

But I see other apps that appear to just be displaying the standard UNICODE 
definitions for common emoji in this chart:

https://apps.timwhitlock.info/emoji/tables/unicode 
<https://apps.timwhitlock.info/emoji/tables/unicode>

Erik

> On Apr 17, 2017, at 3:32 PM, Clint M <[email protected]> wrote:
> 
> as the link mentions… this most likely won't work on android (or windows) as 
> they don't have access to the apple emoji font.
> 
> On Mon, Apr 17, 2017 at 3:28 PM, Clint M <[email protected] 
> <mailto:[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