Search code examples
c#.netsavedllimportintptr

tinyfiledialogs how to save file in russian naming folder


I am using tinyfiledialogs lib and i am able to save files in folders which names are in English but when i try to save the exact same file in folder which name is like for example "Кот" in other words in Russian letter i could not.

This is the code

IntPtr p = tinyfd_saveFileDialog(sDialogTitle, sInitialPathAndFile, 
            filterPatterns.Length, filterPatterns, sPatternDesc);

This is defined in somelib that i am using

        [DllImport("tinyfiledialogs", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)]
        public static extern IntPtr tinyfd_saveFileDialog(string aTitle, string aDefaultPathAndFile, int aNumOfFilterPatterns, string[] aFilterPatterns, string aSingleFilterDescription);

Any help?I am newbee to this lib and could not find any essential information regarding this.


Solution

  • UPDATE: I've just corrected many things in the C# import of the DLLs. Can you give a try to version 3.6.0 with the new DLLs ?

    I am the author of tinyfiledialogs. First make sure you are getting it from the sourceforge site https://sourceforge.net/projects/tinyfiledialogs and not from any of the github copies (generally out of date).

    As reported you should use the UTF-16 (wchar_t - CharSet = CharSet.Unicode) calls. But UTF-8 (char = CharSet.Ansi) also works now.