Bug 47846

Informational

GemStone/S 64 Bit

3.6, 3.5.5, 3.5.4, 3.5.3, 3.5.2, 3.5.1, 3.5, 3.4.5, 3.4.4, 3.4.3, 3.3.9

Utf8 >> withAll: disallowed with ByteArray arguments

The method Utf8>>withAll: has been added, which restricts the composition of Utf8 instances to avoid malformed Utf8.  However, applications that rely on ByteArray inputs containing Utf8 characters may have used withAll: as part of the process of decoding the input, which errors. This was not the intended usage of Utf8.

Workaround

To convert a ByteArray containing UTF-8 encoded text into a string, in v3.5 and later, you can use the methods:
     ByteArray >> decodeFromUTF8ToString
     ByteArray >> decodeFromUTF8ToUnicode

This replaces patterns such as:
   (Utf8 withAll: <aByteArrayContainingEncodings>) decodeToString


Last updated: 5/13/19