autodesk-forks / MaterialX

MaterialX C++ and Python libraries
http://www.materialx.org/
Apache License 2.0
107 stars 23 forks source link

Multi-language and region support #1183

Open ashwinbhat opened 3 years ago

ashwinbhat commented 3 years ago

Region Support: While the mtlx file is utf-8, reading of the values is locale dependent. Consider an value vec3 (1,235.4,1.0) in a xml file. The streambuf reads it in to convert to vec3. The values here are 1, 235.4 and 1.0. If the locale is not set correctly, it will be parsed incorrectly as float 1,235.4 or just fail.

Multi-language The second issue is utf-16 file paths & file names. This is mainly an issue on Windows and requires enabling MaterialX support for wide versions of Windows API and PugiXML. The attached zip contains a mtlx file that cannot be loaded on Windows using the readFromXmlFile API. utf16test.zip