How to reproduce:
1. Open the attached Project "EmojiErrorExample.zip"
2. Build and Run the Scene "SampleScene" on iOS
3. Select the Input Field "Without mobile input"
4. Enter emoji characters into the Input Field
5. Move the Caret between 2 emojis
6. Continue adding emojis
Reproducible with: 2021.3.42f1, 2022.3.42f1, 6000.0.15f1
Reproduced on:
First lines of the Stack Trace:
- thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
frame #0: 0x00000001eb845724 libsystem_platform.dylib`_platform_strlen + 4
frame #1: 0x000000010323e2ac UnityFramework`CreateCppStringFromNSString(NSString*) + 84
frame #2: 0x0000000103241660 UnityFramework`KeyboardOnScreen::GetText() const + 40
frame #3: 0x000000010274c508 UnityFramework`TouchScreenKeyboard_Get_Custom_PropText(void*, BindingsManagedSpan*) + 80
Notes:
- Not reproducible on Android
- The issue sometimes requires multiple emoji inputs to crash
- Another issue that can be observed is the Caret position being incorrect when attempting to move it after adding emojis, the offset increases with more emojis being added