Unity Issue Tracker - Random string values are printed in the Console when passing a new string object initialized with multiple '\0' characters to the Debug.Log function
Fixed
UUM-35559
Random string values are printed in the Console when passing a new string object initialized with multiple '\0' characters to the Debug.Log function
Unity: Mono
Fixed
2023.2.X
2023.1.X
2021.3.X
Won't Fix
2022.2.X
Removed mono's string constructor optimization that assumed memory was cleared.
Removed mono's string constructor optimization that assumed memory was cleared.
Removed mono's string constructor optimization that assumed memory was cleared.
Reproduction steps:
1. Open the attached "FAV_repro_IN-40591.zip" project
2. Click on the Test -> TestEmptyCharToString button in the Toolbar
3. Observe the Console
Expected result: Empty strings are logged in the Console
Actual result: Random strings are logged in the Console