This discussion is archived
3 Replies Latest reply: Sep 11, 2012 7:44 AM by userBDBDMS RSS

Encoding format used in the berkeley db

961079 Newbie
Currently Being Moderated
Hi,

I work on a nms software which uses Berkeley DB 4.3.59 internally.I want to know the type of encoding used by the Berkeley db(UTF8 or some other encoding).
Can somebody tell me how to find out the type of encoding used and if the encoding used is some thing other than UTF-8 is there a way to migrate the character set to UTF8(or any other unicode)??
The product also uses mysql db,and i could find out the type of encoding used in the mysql db pretty easily, but its not the case in case of Berkeley db .I have been searching for this info for so much time now but have not been able to find any useful info.

Thanks,
Siri
  • 1. Re: Encoding format used in the berkeley db
    userBDBDMS Guru Moderator
    Currently Being Moderated
    Hi Siri,

    The data that is stored in the berkeley database is transparent to the BDB database code. In other words, there is nothing in the library that looks at the data portion to try and determine what it is or is not. For the data portion you are free to use whatever encoding you want because it is up to the application to interpret the data. For things like error messages and other types of displays that are returned from BDB, we use the ASCII character set.

    regards,
    mike
  • 2. Re: Encoding format used in the berkeley db
    961079 Newbie
    Currently Being Moderated
    Thanks for the response Mike.

    Does that mean the application itself has to take care of converting strings to certain type of byte sequence to put in to the db and while retrieving it also its the application's responsibility to interpret the byte sequence ??

    Thanks,
    Siri
  • 3. Re: Encoding format used in the berkeley db
    userBDBDMS Guru Moderator
    Currently Being Moderated
    Hi Siri,

    The BDB library does not interpret the user's data. This is the responsibilty of the application. If you are using BTREE access method you should make sure you understand you key values and should understand how they are handled with comparison function. BDB provides a default comparison function, and the application can define its own. If you want the keys sorted in a particular manner you should consider using your own comparison function. Detailed information is in the documentation.

    thanks
    mike

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points