JNI: NewStringUTF (modified UTF-8) mangles astral-plane chars — emoji alphabet text is corrupted in transit
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 52/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Área
- internationalization, mobile
Línea de trabajo
Start in jni_bridge.cpp: run a search for NewStringUTF and GetStringUTFChars, and check the output callback near line 189 first. The fix is to build engine-to-Kotlin strings from UTF-16 with NewString and to handle the Kotlin-to-engine direction the same way. Done when an emoji from the engine arrives intact in Kotlin, and a round-trip test with an astral-plane character passes.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Follow-up from the #71 review loop (review M3, pre-existing).
jni_bridge.cpp uses env->NewStringUTF(...) for engine→Kotlin strings (e.g. output callback text at jni_bridge.cpp:189 and friends). JNI's NewStringUTF expects modified UTF-8 (CESU-8): 4-byte UTF-8 sequences — every astral-plane codepoint, i.e. most emoji — are invalid and get mangled. Since c003214 the app ships an Emoji alphabet, so astral chars are a live output path: the engine emits correct UTF-8, the Kotlin side receives garbage.
(The UTF-16-level coalescing contract added in #71 is correct at the Kotlin layer — ImeOutputCoalescerTest pins it — but the runtime path through JNI corrupts the string before Kotlin sees it.)
Fix pattern: decode UTF-8 → UTF-16 manually (or via String::fromUTF8 helpers) and construct with env->NewString(utf16, len). Audit every NewStringUTF in jni_bridge.cpp; also check the reverse direction (GetStringUTFChars — same modified-UTF-8 caveat) for Kotlin→engine strings (training import, seedBuffer).
Split out of #71 to keep that PR scoped to the batching fix.
- Lenguaje dominante
- Kotlin
- Estrellas
- 2
- Forks
- 0
- Merge medio
- 4 h 45 min
- PR fusionados (30 d)
- 7
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de dasher-project/Dasher-Android
-
enhancement
Dificultad 3/5 1-2 días Aptitud para principiantes 72/100
-
enhancement
Dificultad 3/5 1-2 días Aptitud para principiantes 68/100
-
UX: IME needs editing tools (backspace, cursor movement) — 'I go back and forth with SwiftKey'Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 68/100
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 42/100
-
bug
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
dasher-project/Dasher-Android#34 · 1 comentario ·
Todos los issues de dasher-project/Dasher-Android
Issues similares
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 85/100
react/react-native#59693 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
-
Keep a caller-supplied `screen` entity instead of attaching the tracker’s current screenPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
-
Itch.io full searchAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
Droid-Deck/DroidDeck#1852 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 80/100
pengchujin/aerial-tv#989 · 3 comentarios ·
Los mantenedores suelen responder en 1 día