You are using binary format, but your length calculation is wrong:
int len1 = (int) name.length() * sizeof( wchar_t );
Just use text format for a query like this.