This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- XML encoding strings
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Oct 26, 2009
09:43 AM
XML encoding strings
We have an issue with writing strings into an XML file. A dialog in our install asks for a username and then stores it in an XML config file (which has been installed by the installer).
If a user enters a name such as "doom&gloom", this is then written as it is - which of course breaks the XML. Is there a way to escape this correctly from within InstallScript so that it is written as "doom&gloom"?
I could be missing something but I can't find an equivalent of Asc() or charCodeAt() in InstallScript.
If a user enters a name such as "doom&gloom", this is then written as it is - which of course breaks the XML. Is there a way to escape this correctly from within InstallScript so that it is written as "doom&gloom"?
I could be missing something but I can't find an equivalent of Asc() or charCodeAt() in InstallScript.
(1) Reply
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Oct 27, 2009
10:22 AM
Ha - just noticed that the forum has "fixed" my strings so the question looks wrong: the desired output should be
Anyway, I've worked it out - by using array syntax (such as "szString[nPos]") to get the character at a position, I can then compare it to character values using STRTOCHAR() if necessary. I can format the value into my output string with Sprintf() and end up with the correct formatted string.
doom& ;gloom
^ - Ignore this space, needed to prevent the forum "fixing" it.
Anyway, I've worked it out - by using array syntax (such as "szString[nPos]") to get the character at a position, I can then compare it to character values using STRTOCHAR() if necessary. I can format the value into my output string with Sprintf() and end up with the correct formatted string.