I’m trying to write an XML file with UTF-8 encode, and the original string can have invalid characters like ‘á’, so, i need to change these invalid characters to a valid ones.
I know that there is an encoding method that take, for example, character á and transform it to group of characters á.
I am trying to achive this with C#but i have no succes on it. I am using Encoding.UTF8 functions but i only end with the sema character (i.e: á) or a ‘?’ character.
So, do you know with is the correct way to achive this character change with C# ??
Thanks for your time and help 🙂
LLORENS
á is not an “invalid” character. It has a UTF-8 encoding (bytes 195 and 161), and Nick is right that if you construct everything correctly this will be transparent.