Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unity using “−” (U+2212) as negative sign in generated C++

When I try to build my project (I have tried building for Android and Universal Windows Platform), building fails due to a MINUS SIGN (U+2212) character being used in the generated C++ as a negative sign. I am in Unity 2020.2/Android 11 SDK/GPGS 10; I built successfully with Unity 2019/Android 10 SDK/GPGS 9.

I have searched for “−” (and “2212” for good measure) in all asset, cs, meta, prefab, txt, unity, and xml files in the project and found nothing (other than a coincidental file ID 616832212, sprite ID 9561e3c67a82d7f448852212eb8fac6b, and binary files that technically match). I also tried having Unity reinstall packages and rebuild Library; no luck.

For a UWP build, I opened [build output directory]\Il2CppOutputProject\Source\il2cppOutput\Generic8.cpp and confirmed the “−” character appears in that way repeatedly in the file—e.g.,

19990:IL_0063:
19991:  {
19992:      return (int32_t)(−1);
19993:  }
19994:}

The error for an Android build is:

Exception: Unity.IL2CPP.Building.BuilderFailedException: C:\[path to project folder]\Library\Il2cppBuildCache\Android\armeabi-v7a\il2cppOutput\Assembly-CSharp.cpp:20814:155: warning: treating Unicode character <U+2212> as identifier character rather than as '-' symbol [-Wunicode-homoglyph]
                AndroidClient_InvokeCallbackOnGameThread_TisUIStatus_t34F64DC1927A392210216047169D4E196183BD14_m78B26B077A1A979B11C5596B45DC6E9A1A2929B6(L_1, ((int32_t)<U+2212>3), /*hidden argument*/AndroidClient_InvokeCallbackOnGameThread_TisUIStatus_t34F64DC1927A392210216047169D4E196183BD14_m78B26B077A1A979B11C5596B45DC6E9A1A2929B6_RuntimeMethod_var);
                                                                                                                                                                        ^~~~~~~~
C:\[path to project folder]\Library\Il2cppBuildCache\Android\armeabi-v7a\il2cppOutput\Assembly-CSharp.cpp:20814:155: error: non-ASCII characters are not allowed outside of literals and identifiers
                AndroidClient_InvokeCallbackOnGameThread_TisUIStatus_t34F64DC1927A392210216047169D4E196183BD14_m78B26B077A1A979B11C5596B45DC6E9A1A2929B6(L_1, ((int32_t)<U+2212>3), /*hidden argument*/AndroidClient_InvokeCallbackOnGameThread_TisUIStatus_t34F64DC1927A392210216047169D4E196183BD14_m78B26B077A1A979B11C5596B45DC6E9A1A2929B6_RuntimeMethod_var);
                                                                                                                                                                        ^~~~~~~~

(And then the same thing continues to repeat for dozens more instances.)

like image 326
Zachary Yaro Avatar asked Oct 15 '25 22:10

Zachary Yaro


1 Answers

I got the same issue, switching to UK (from Sweden) solved it (not physically, changed in System settings: Language/Region)

like image 93
user603239 Avatar answered Oct 18 '25 20:10

user603239



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!