Hi,

Jonas found the following issue.

Converting a UChar array with multiple zero characters tucked at the end of the array produces a different size string on DF19.1 and earlier than it does on DF20.0

One can argue that it is expected, but this is one of those surprises that can byte you.

Code:
Use Windows.pkg

// Discovered by Jonas Ekström 
Procedure UCharArrayToString_Test1
    UChar[] uaCharacters
    String sResult
    Integer iExpectedLength
    
    Move (Ascii("t")) to uaCharacters[SizeOfArray(uaCharacters)]
    Move (Ascii("e")) to uaCharacters[SizeOfArray(uaCharacters)]
    Move (Ascii("s")) to uaCharacters[SizeOfArray(uaCharacters)]
    Move (Ascii("t")) to uaCharacters[SizeOfArray(uaCharacters)]
    Move 0 to uaCharacters[SizeOfArray(uaCharacters)]
    Move 0 to uaCharacters[SizeOfArray(uaCharacters)]
    Move (UCharArrayToString(uaCharacters)) to sResult
    
    // DataFlex 18.1 - 19.1 does not return the same result as 20.0
    // DFCompatibilityLayer returns the same result as 20.0
    Showln "Array has " (SizeOfArray(uaCharacters)) " characters"
    Showln "String has " (Length(sResult)) " characters"
End_Procedure

Send UCharArrayToString_Test1

Inkey WindowIndex
Run it on DF19.1 and the output is:
Array has 6 characters
String has 6 characters
Run is on DF20.0 and you'll get:
Array has 6 characters
String has 5 characters
--
Wil