You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
$substring throws IndexOutOfBoundsException on strings with non-BMP characters when length is omitted or too large #461
$substring(str, start) throws java.lang.IndexOutOfBoundsException when str contains a non-BMP character (a code point above U+FFFF, stored in Java as a surrogate pair). This includes emoji such as 😀 (U+1F600) and also mathematical letters such as 𝒳 (U+1D4B3).
JSONata JS counts code points and returns the substring.
Problem
$substring(str, start)throwsjava.lang.IndexOutOfBoundsExceptionwhenstrcontains a non-BMP character (a code point above U+FFFF, stored in Java as a surrogate pair). This includes emoji such as😀(U+1F600) and also mathematical letters such as𝒳(U+1D4B3).JSONata JS counts code points and returns the substring.
Reproduce