0 Replies Latest reply: Jun 17, 2014 8:19 PM by 845b180d-3da9-43df-80ee-fa2133bd6f28 RSS

    Berkeley DB, Open Path Language Problem in C# (WPF)

    845b180d-3da9-43df-80ee-fa2133bd6f28

      Hi.

       

      I have a problem with CreateDB and Open because DB File path of language.

      I am using Korean Language.(south korea).

      So I need to use necessary DB file named of korean.

       

      Here is my problem.

       

                   btreeConfig = new BTreeDatabaseConfig();

                   btreeConfig.Duplicates = DuplicatesPolicy.UNSORTED;

                   btreeConfig.ErrorPrefix = "fileDb";

                   btreeConfig.Creation = CreatePolicy.IF_NEEDED;

                   btreeConfig.CacheSize = new CacheInfo(0, 256 * 1024*1024, 1);//256MB

                   btreeConfig.PageSize = 64 * 1024;//64KB

       

                  System.Text.Encoding utf8 = System.Text.Encoding.UTF8;
                  byte[] utf8Bytes = utf8.GetBytes(dbFileName);
                  string decodedStringByUTF8 = utf8.GetString(utf8Bytes);

                  dbFileName = decodedStringByUTF8;
                  /* Create and open a new database in the file. */
                  try {
                      btreeDB = BTreeDatabase.Open(utf8.GetString(utf8Bytes), btreeConfig);
                  } catch (Exception e) {
                      Console.WriteLine("Error opening {0}.", dbFileName);
                      Console.WriteLine(e.Message);
                      return -1;
                  }

       

      If dbFileName has a any korean word, exception will occured.(No such file or directory).

       

      This is my Big problem in currently.

       

      Is there any solution??

       

      Thanks.