[wasm][aot] Force python to default to UTF8 (#53557)
authorAnkit Jain <radical@gmail.com>
Wed, 2 Jun 2021 16:54:44 +0000 (12:54 -0400)
committerGitHub <noreply@github.com>
Wed, 2 Jun 2021 16:54:44 +0000 (12:54 -0400)
src/mono/wasm/build/WasmApp.Native.targets

index 9288eb7..5c4ef04 100644 (file)
 
     <ItemGroup>
       <EmscriptenEnvVars Include="PATH=$(_EmscriptenPrependPATHProperty)$(_PathSeparator)$([MSBuild]::Escape($(PATH)))" />
+
+      <!--
+        Python defaults to the system charset, and thus expects the files it's reading to
+        match that. But that might not always be true. Eg. system charset=gbk, failing to read
+        utf-8 files
+
+        See https://github.com/dotnet/runtime/issues/53367 for the motivating issue
+      -->
+      <EmscriptenEnvVars Include="PYTHONUTF8=1" />
     </ItemGroup>
   </Target>