Use string_chars instead of string_to_utf8 in UNICODE mode#30
Closed
xelrach wants to merge 1 commit intoNeighTools:masterfrom
Closed
Use string_chars instead of string_to_utf8 in UNICODE mode#30xelrach wants to merge 1 commit intoNeighTools:masterfrom
xelrach wants to merge 1 commit intoNeighTools:masterfrom
Conversation
Member
|
Greetings! Thank you for your PR and sorry for the wait! I see this being an issue on Windows where strings might be internally Unicode depending on mono version. However, I am unsure how well that applies to all mono versions on different OSs. How about instead of using char *exc_str_n = mono.string_to_utf8(str);
char_t *exc_str = widen(exc_str_n);
LOG("Error message: %s", exc_str);
https://github.com/NeighTools/UnityDoorstop/blob/master/src/util/util.h#L36-L44
|
Collaborator
|
This issue was resolved by merging #58 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The original code was taking a MonoString and then calling string_to_utf8 on it. That result was passed to LOG, which called narrow on the result, which was mangling our string.
Before:
Error invoking code!
Error message: 祓瑳浥吮灹䱥慯䕤捸灥楴湯›潃汵潮⁴潬摡琠灹景映敩摬✠協獅楰湯条獅楰湯条䍥湯楦㩧楨敤汐祡牥 ...
After:
Error invoking code!
Error message: System.TypeLoadException: Could not load type of field 'TSEspionage.EspionageConfig:hidePlayers' (1) due to: Could not load file or assembly 'System.Collections, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. assembly:System.Collections, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a type: member:(null) signature:
at Doorstop.Entrypoint.Start () [0x00001] in ...