Error "Invalid UTF-8 string in BSON document" after rebuild on Windows

Hello.

After successful rebuild mongod.exe 7.0.12 when connecting to MongoDB Compass, the message “Invalid UTF-8 string in BSON document” is displayed.

When rebuilding the sources in Ubuntu, no such message is displayed.

If you take a ready-made exe file, then of course everything works.

The command to build: python buildscripts/scons.py install-mongod MONGO_VERSION=7.0.12 --release --disable-warnings-as-errors --separate-debug=on

Maybe some flag is missing for the build or I’m missing something.

Please tell me, maybe someone has encountered such a problem as it is solved.

Thanks in advance for any hint.