MelonLoader

MelonLoader

242 Downloads

[Bug]: Unicode characters not supported in names (method, type...)

laymain opened this issue ยท 5 comments

commented

All of the following criteria must be met

  • All Requirements must be installed.
  • Changed the title so that it doesn't just says "[Bug]: "
  • I have searched the GitHub issues for my bug, even in the closed issues.

All of the following are optional to answer

  • Tried reinstalling the Game.
  • Tried reinstalling MelonLoader.
  • Tried restarting PC.
  • Was able to see the Start Screen.

Describe the issue.

Hi there,

I am facing an issue with Rewired library and IL2CPP, MelonLoader is not able to load the dependency because of an invalid name:

[01:18:23.989] [DEBUG] [AssemblyVerifier] Il2CppRewired_Core.dll Has an Invalid Type Name String "MethodInfoStoreGeneric_nqXVGKvgfzozBIAcnvWAyMFzaDld_Internal_Static_Int32_IList_1_โ˜บ_Predicate_1_โ˜บ_Int32_0`1"

Latest.log

commented

Submitted a PR to Il2CppInterop, hopefully it will be merged ๐Ÿคž

commented

This is arguably a bug in Il2cppInterop which should have renamed the type to not contain those characters (so that they can be referenced in c# source code, if nothing else)

commented

I'm not sure to understand, in C#, Unicode characters are allowed for type and method names
https://learn.microsoft.com/en-us/dotnet/csharp/fundamentals/coding-style/identifier-names

[EDIT]
Hum... you're right, there seem to be a non-valid character in this name, but some are valid,
AssemblyVerifier could take inspiration from https://github.com/microsoft/referencesource/blob/51cf7850defa8a17d815b4700b67116e3fa283c2/System/compmod/system/codedom/compiler/CodeGenerator.cs#L1926-L1968

commented

To be clear, what I mean by invalid character is that we should, in theory, force all type and member names to contain only printable ascii characters. Whether or not you can in theory have an emoji in c# type names isn't particularly relevant because they will be a pain to type in an IDE anyway.

commented

Il2CppInterop has been updated in the latest MelonLoader builds.