Encoding problem "]" is replaced with "]5D;" RRS feed

  • Question

  • Hi. I´m passing string value to interface in .dll file. This interface puts my string value into xml element (creates XML file). But if my string value contains character like "]", it is replaced with "]5D;"

    Any suggestions what should I do differently? It´s seems some kind of coding issue but I can not see that´s going on the interface .dll (perpahs the problem is in the .dll)

    Wednesday, August 13, 2014 2:15 PM

All replies

  • Hi GaiusBaltar,

    XML file will treat [ or ] as special characters. You could try to use the numeric reference instead as the string value. However as you don't know the implementation of the interface, it's better to contact the developer of the dll for help, probably it's a bug.











    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Edited by Caillen Thursday, August 14, 2014 6:44 AM
    Thursday, August 14, 2014 6:39 AM
  • "XML file will treat [ or ] as special characters"

    Not really, there's no reason for ] to be encoded in xml. The following samples shows that .NET's XmlWriter doesn't do this:

    using System;
    using System.Xml;
    class Program {
        static void Main() {
            using (var w = XmlWriter.Create(Console.Out))
                w.WriteElementString("foo", "[bar]");
    The output is <foo>[bar]</foo>.

    Thursday, August 14, 2014 7:42 AM
  • Seems that DLL is trying to encode non-alphanumeric characters, but instead of ‘&#x5D;’ it gives ‘]5D;’. Looks like a problem of DLL, or maybe of the reader. How did you check the generated XML file?

    Thursday, August 14, 2014 1:39 PM