Comments (4)
What happens when you type an emoji? I assume the font you use doesn't render it or do you actually have a font that renders the emoji?
from gooey.
I tried the utf8 module in the same way as the backspace key is handled and it generates the correct result:
assert(utf8.sub("a😄b", 1, -2) == "a😄")
assert(utf8.sub("a😄", 1, -2) == "a")
from gooey.
Odd. Doing the same within Gooey gives me this call stack.
ERROR:SCRIPT: /gooey/internal/utf8.lua:128: Invalid UTF-8 character
stack traceback:
[C]: in function 'error'
/gooey/internal/utf8.lua:128: in function 'utf8charbytes'
/gooey/internal/utf8.lua:226: in function 'sub'
/gooey/internal/input.lua:153: in function 'input'
/gooey/gooey.lua:162: in function 'input'
/example/dirtylarry.gui_script:45: in function 'fn'
/gooey/gooey.lua:184: in function 'group'
/example/dirtylarry.gui_script:16: in function </example/dirtylarry.gui_script:15>
What I am doing is super straight forward. Simply inputting a smiley triggers it in this case.
- Open up dmengine.apk
- Target phone and build
- Go to dirty larry
- Click top input box, switch to the "emoji keyboard"
- Type emoji
from gooey.
Emojis more investigation. In Java an emoji can't be represented in a single UTF-16 character, it actually needs two. The emoji is converted into a surrogate pair, one high and one low character.
https://developers.redhat.com/blog/2019/08/16/manipulating-emojis-in-java-or-what-is-%F0%9F%90%BB-1/
http://www.unicode.org/versions/Unicode12.1.0/ch03.pdf#G2630
In Defold we simply take the codepoint of the the two UTF-16 characters and encode these to UTF-8 and forward to Lua
- DefoldActivity.java sendInputText()
- hid.cpp AddKeyboardChar
I'm still not sure how this should be handled to be honest and I've already spent too much time on this. Investigation has to continue later.
from gooey.
Related Issues (20)
- Input state machine doesn't include 'released_now' or 'clickable' fields on last frame HOT 13
- Scroll list flick
- Bug: If dynamic list becomes empty, items have invalid data attached HOT 3
- Using character . after numbers will introduces extra characters on mobile HOT 6
- Missing return checkbox instance in set_checked or set_visible HOT 1
- Scrolling wheel speed option
- How can I change the theme ? HOT 2
- No typing input from Android browsers HOT 2
- Missed backspaces on iOS
- Grid component
- .nodes failing on list items in dynamic_list HOT 3
- Input widget's "deselected_now" property always false
- List data HOT 1
- Lists are not updated on list refresh since 10.0.0 HOT 2
- Fix for trailing spaces creates issues
- Dynamic List Refresh Behavior HOT 3
- Example project missing sprites and runtime errors HOT 4
- Radio parameter description missing
- Feature request: UI navigation HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gooey.