ok, that is gonna make peoples heads explode lol.
null and nullptr are named constants for zero, sure, but please do not use them for zero or in place of other constants.
'\0' is the null terminal for c-strings, if you want to type 4 chars where 1 will do.
I just use 0 directly. Its less visual clutter and anyone using c-strings will understand it. If that bugs you, make your own constant or use the literal clutter value. But please, do not use pointer constant for zero terminal string. It will work, but it will have all your peers looking for your head with an axe.
back on topic, not sure what exactly you are up to but I will tell you that most databases allow you to use non ascii encodings and if you try to read that as ascii you will get weirdness. So even if you do everything right you can have this effect, so if you believe you are doing things right check the settings before trying to debug a non-bug. Nothing is worse than assuming your code is wrong when its doing what you wanted and just got scrambled input -- you will invariably 'fix' the correct code, breaking it.. It could also be that you have asked for something stored in binary and jacked it into text. Have you done a raw hex comparison of expected value vs value you got back?