s4-ldb: fixed a crash bug for non-UTF8 strings