When a multi-byte character needed to be turned into a single "_", the final returned string would be too large in size. Resize it to the exact number of bytes required and add test coverage. Pull Request: https://projects.blender.org/blender/blender/pulls/126164