Blender Git Commit Log

Git Commits -> Revision 5496d8c

Revision 5496d8c by Ray molenkamp (master)
January 26, 2021, 21:56 (GMT)
Windows: Fix wchar_t truncation

BLI_strncpy_wchar_from_utf8 made the assumption that
wchar_t is UTF-32 bit regardless of environment, while
this holds true on both mac and linux, on windows
wchar_t is actually actually UTF-16.

This resulted in the upper 16 bits being dropped from
from some string conversions and prevented blender
from starting when installed in a path with unicode
code-points over 0xffff.

There was also a fair bit of code duplication between
BLI_strncpy_wchar_from_utf8 and BLI_str_utf8_as_unicode_and_size

this change essentially removes all logic from
BLI_strncpy_wchar_from_utf8 and calls the right function
for the right environment.

Reviewed By: brecht , Robert Guetzkow

Differential Revision: https://developer.blender.org/D9822

Commit Details:

Full Hash: 5496d8cd361385268316f91afa150e69b5345ab0
Parent Commit: d9a63d4
Lines Changed: +7, -32

1 Modified Path:

/source/blender/blenlib/intern/string_utf8.c (+7, -32) (Diff)
By: Miika HämäläinenLast update: Nov-07-2014 14:18MiikaHweb | 2003-2021