Menu

MediaInfoDLL C# on Linux Mono has issues with Unicode Filenames

Help
2019-10-20
2019-10-20
  • Thomas Baer

    Thomas Baer - 2019-10-20

    Okay, so I'm running libmediainfo.so (linux) via a default copy of MediaInfoDLL.cs on mono. I feed it a file with a unicode filename. Through the debugger, I have determined that it goes through MustUseAnsi, then MediaInfoA_Open(Handle, MemoryPointer). The problem is that somewhere in there it fails.

    I played around with it and this is what I gathered:
    If I let it go without changing anything, it returns 0, and I don't process any more, as that means it failed to open the file.
    If I remove the check that it opened and force it to continue, then about half of the files, it works with correct results. The other half, everything returns 0.
    If I bypass the MustUseAnsi and open check, then it just returns 0 for everything.

     
  • Jerome Martinez

    Jerome Martinez - 2019-10-20

    We didn't test especially on Mono (not used by our sponsors), we'll have a look when we have some free time.

     
  • Thomas Baer

    Thomas Baer - 2019-10-20

    Cool, thanks. Any tips for how I might debug on my own further? I can do C++ debugging, if needed. Though, I'm not sure how to debug through mono, so I'd probably just starting logging extensively.

     

    Last edit: Thomas Baer 2019-10-20
    • Jerome Martinez

      Jerome Martinez - 2019-10-20

      It is somewhere in the workflow, from conversion to/from wide chars (2-byte on Mono & 4-byte on C++ then converted to 1-char local code page for Linux, if I remember well), it is maybe in MediaInfoDLL.cpp, File_Reader.cpp, or ZenLib/File.cpp.

       

Log in to post a comment.