Uploaded image for project: 'Spring.NET'
  1. Spring.NET
  2. SPRNET-1366

Allow for configuration of UTF8 preamble generation and the check for invalid bytes in XmlMessageConverter.

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Complete
    • Affects Version/s: 1.3.0
    • Fix Version/s: 1.3.1
    • Component/s: Spring-NET-MSG
    • Labels:
      None

      Description

      By default the XmlMessageConverter GetXmlString will generate UTF8 preamble and include it in a message posted to Tibco.
      For some scenarios system on the other side (especially Java) doesn't expect preamble (chars 239,187,191).

      It gets there because the accessing Encoding.UTF8 returns an instance of UTF8 encoder that will create BOM (Byte Order Mark)
      (For the Encoding.UTF8 the constructor of UTF8Encodingr is called with encoderShouldEmitUTF8Identifier set to true, while teh default one is false).

      I think that for simple XmlMessageConverter it would be easier to just have a static encoder on class level.
      Should also benefit performance, as there is no need to create new instance of envoder for each conversion helpers (
      UTF8ByteArrayToString and StringToUTF8ByteArray).

      Another topic - there is probably a reason for that, but way the XmlTextWriter and MemoryStream doesn't follow the 'using pattern'?

        Attachments

          Activity

            People

            Assignee:
            mark.pollack Mark Pollack
            Reporter:
            stic Stefan Turalski
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: