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.
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.
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 ??
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.