-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error strings not passed through #11
Comments
Hey, |
Actually I think we managed to find out why. Which works fine on English devices but break if there are special characters like in case of our machines which some of them were in Finnish localization. Windows messages should always be treated as UTF encoded I believe (they have been moving from ANSI to UTF over time and I think most if not all is now UTF). This has been quite invisible for English users since ANSI==UTF when dealing with only English alphabet. We are still testing and I will keep you informed on how it goes, I think you can test and break the system if you switch localization some European language with umlaut characters (we have ä and ö in Finnish). We are running on Windows Home and Pro 64-bit, nothing special. |
One more update: So running as a test For the error code 2 The Finnish error would be "Määritettyä tiedostoa ei löydy." = "The system cannot find the file specified." If using the Marshal.PtrToStringAnsi(lpMsgBuf) method it won't work because of the ä and ö characters. I noticed that just changing it to Marshal.PtrToStringUTF8(lpMsgBuf) won't work either, because the Unity managed-to-native wrapper will try to internally call the Ansi method still so the problem persists. However making a method to do the conversion is quite easy so I added a function
that I use to convert it and it works. Unity won't still show the ä and ö properly, but that is because of the font asset. At least the string gets through without issues using that. I hope this helps. |
Error codes from the DLL plugin does not pass through.
Unable to get error code string from System -> System.ExecutionEngineException: String conversion error: Illegal byte sequence encounted in the input.
at (wrapper managed-to-native) System.Runtime.InteropServices.Marshal.PtrToStringAnsi(intptr)
The text was updated successfully, but these errors were encountered: