Deserialize XML with UTF-16 encoding in ServiceStack.Text -
i trying use servicestack.text deserialize xml.
code:
var buildevent = dto.eventxml.fromxml<tfseventbuildcomplete>();
the opening xml line is:
<?xml version="1.0" encoding="utf-16"?>
servicestack fails following error:
the encoding in declaration 'utf-16' not match encoding of document 'utf-8'.
i can see source of xml serializer servicestack uses utf-8.
i wondering whether servicestack.text can deserialize utf-16 , if how? , if not, why not?
i have managed hack way around issue. i'm not proud of but....
var buildevent = dto.eventxml.replace("utf-16", "utf-8").fromxml<tfseventbuildcomplete>();
Comments
Post a Comment