Page MenuHome

Fix: BLI_getenv returns ascii rather than UTF-8 on windows
ClosedPublic

Authored by Ray Molenkamp (LazyDodo) on Dec 11 2020, 6:49 PM.

Details

Summary

T74510 seems to be turning into a jumble of various encoding
related issues, this is one of them.

This specific patch fixes the incorrect behaviour of BLI_getenv returning ascii on windows rather than utf-8 resulting in problems when using the BLENDER_USER_CONFIG environment variable to point to a path with non ascii characters.

all tests pass on windows, given all code is in a windows only guard no testing should be needed on other platforms.

Diff Detail

Repository
rB Blender

Event Timeline

Ray Molenkamp (LazyDodo) requested review of this revision.Dec 11 2020, 6:49 PM
Ray Molenkamp (LazyDodo) created this revision.
This revision is now accepted and ready to land.Dec 11 2020, 7:07 PM
source/blender/blenlib/intern/path_util.c
1329

Seems like we both missed the memleak here, if the buffer was valid, but didn't fit in the static buffer, unlikely to happen, but still sloppy. fixed in rB0dbbcaf1e6bb