简体   繁体   中英

How to displaying Emojis and UTF-8 text in Flutter/Java

I'm trying to simply show text in Flutter, but text should be in UTF-8 and should be able to display emojis also.

I can't get them both working at the same time, because when I try to decode for example input: löäjhlöäpüüõä', which is saved to base like so: savedEmojis with UTF8

  • to UTF-8 in Flutter with emojis - child: Text(utf8.decode(item.content.runes.toList()))

I will get "FormatException: Invalid UTF-8".

If I do other way around, and input is not decoded, the emojis work fine, but UTF-8 chars are ruined. UTF8text without decode

-- Emojis are inserted to DB through Angular "ngx-emoji-mart"

Thank you in advance, if you know how to resolve this text problem

You can use Java codes inside a string: String string = 'This is an example with emoji ❤';

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM