def _parrot_str_to_str(val):
    """
    Encoding-safe way of turning a Parrot string into a Python string.
    """
    encoding = val['encoding'].dereference()
    encoding_name = encoding['name'].string()
    length = val['strlen']

    return val['strstart'].string(encoding=encoding_name,length=length)