Is there a native WinAPI to call to escape a string for HTML/XML into < > etc?
Is there a native WinAPI to call to escape a string for HTML/XML into
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The Windows API does not provide any such simple function, to the very best of my knowledge. That sort of functionality is typically provided by libraries.
Normally you will be using an HTML or XML library to generate your HTML or XML. That’s almost always a better strategy than trying to assemble it yourself. And those libraries will do the necessary escaping for you.
For example, a commonly used library to work with XML on Windows is MSXML. You can use that library to parse and emit XML and it will take care of escaping for you.