Skip to content

Commit d1c18af

Browse files
committed
Mention in the Compatibility guide UTF-16 and UTF-32 requires correct number of bytes in String
Folloup for #3410
1 parent 656d61b commit d1c18af

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

doc/user/compatibility.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,10 @@ The JVM enforces a maximum array size of 2<sup>31</sup>-1 (by storing the size i
121121
That is, Strings must be smaller than 2GB. This is the same restriction as JRuby.
122122
A possible workaround could be to use natively-allocated strings, but it would be a large effort to support every Ruby String operation on native strings.
123123

124+
### Strings in UTF-16 and UTF-32 encoding
125+
126+
TruffleRuby does not support UTF-16 strings with an odd number of bytes (in native endianness). Similarly, with UTF-32 it needs to be a multiple of 4.
127+
124128
### Threads detect interrupts at different points
125129

126130
TruffleRuby threads may detect that they have been interrupted at different points in the program compared to where they would on MRI.

0 commit comments

Comments
 (0)