How to change the encoding configuration of an SVG file from UTF-16 to UTF-8
Environment
Product Version | Product | Author |
---|---|---|
2022.2.622 | PictureBox for WinForms | Dinko Krastev |
Description
When trying to show an SVG XML file inside the RadPictureBox control, while this file is encoded with the UTF-16 algorithm, an error will be thrown. The RadPictureBox internal reader will throw System.Xml.XmlException: 'There is no Unicode byte order mark. Cannot switch to Unicode.'.
Solution
To make this work we need to change the encoding attribute in the SVG XML file at the top. You can try to manually open the file in an editor and change the encoding attribute to utf-8 or use custom code.