bytes = np.fromstring(s.encode('utf-8'), np.uint8)
atom = pt.UInt8Atom()
filters = pt.Filters(complevel=complevel, complib=complib)
ca = h5file.create_carray(group, nodename, atom, shape=(len(bytes),),
    filters=filters)
ca[:] = bytes
return ca

def retrieveStringFromHDF5(node):
    return str(node.read().tostring(), 'utf-8')
How do you create a compressed dataset in pytables that can store a Unicode string?