unicode/str problem in open database func