BUG: Fix unconverting of long strings from HDF (GH6166)

superseeds #6166