[Bf-blender-cvs] [73d8015aa3b] master: Fix T79801: openvdb cache does not support Unicode paths on windows

Ray Molenkamp noreply at git.blender.org
Thu Jun 2 19:18:49 CEST 2022


Commit: 73d8015aa3be539089bd8ec17a9f914b4524c5e7
Author: Ray Molenkamp
Date:   Thu Jun 2 11:18:43 2022 -0600
Branches: master
https://developer.blender.org/rB73d8015aa3be539089bd8ec17a9f914b4524c5e7

Fix T79801: openvdb cache does not support Unicode paths on windows

"Fix" should be taken with a grain of salt, this will fix
the issue on win10 1903 and newer.

OpenVDB uses boosts memory mapped files which call
CreateFileA in the back-end when you feed it a
regular string.

now the encoding for CreateFileA will be whatever the
default is for the system, it internally turns it into
a wide string with said encoding and calls CreateFileW.

This change changes that encoding to UTF-8 for just
blender so we can use utf-8 with any of the narrow
api functions. This is a manifest change and only win10
1903 will look for it, so that sadly limits the fix
to only a subset of users.

While ideally we would have fixed the issue our selves,
some of the calls to openvdb::io::file::open are beyond
our control (ie from inside USD or Mantaflow)

Note: This only changes the behaviour in regard to Win32
API functions, regular CRT functions like fopen or if_stream will
still not accept utf-8 filenames.

Differential Revision: https://developer.blender.org/D14981
Reviewed by: brecht

===================================================================

M	release/windows/manifest/blender.exe.manifest.in

===================================================================

diff --git a/release/windows/manifest/blender.exe.manifest.in b/release/windows/manifest/blender.exe.manifest.in
index b516efe24cb..95a238f775b 100644
--- a/release/windows/manifest/blender.exe.manifest.in
+++ b/release/windows/manifest/blender.exe.manifest.in
@@ -7,6 +7,11 @@
       </requestedPrivileges>
     </security>
   </trustInfo>
+  <application>
+    <windowsSettings>
+      <activeCodePage xmlns="http://schemas.microsoft.com/SMI/2019/WindowsSettings">UTF-8</activeCodePage>
+    </windowsSettings>
+  </application>  
   <compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1"> 
         <application> 
             <!-- Windows 10 -->



More information about the Bf-blender-cvs mailing list