Rewrite textblock_dump to do correct encoding