core: decode now returns DecodedStr with original string encoding