Uploaded image for project: 'OASIS Open Data Protocol (OData) TC'
  1. OASIS Open Data Protocol (OData) TC
  2. ODATA-764

Need clarification of valid character values for Edm.String in relation to ATOM (XML 1.0)

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Deferred
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: V4.0_CS02
    • Fix Version/s: None
    • Component/s: ATOM Format
    • Labels:
      None
    • Proposal:
      Hide

      1. Mention in Protocol spec that some protocols may not be able to encode values for all Unicode characters, or...

      2. Recommend using Edm.String only for properties that are guaranteed to contain content that can be represented in all formats supported by the server, and use Edm.Binary otherwise (puts burden on service modeler)

      Only as a last resort:

      3. Determine an (OData-proprietary) approach to encode all valid Unicode characters in ATOM, e.g. encode backspace as:

      {U+0009}

      (That is, eight separate characters indicating a Unicode HEX value).

      Show
      1. Mention in Protocol spec that some protocols may not be able to encode values for all Unicode characters, or... 2. Recommend using Edm.String only for properties that are guaranteed to contain content that can be represented in all formats supported by the server, and use Edm.Binary otherwise (puts burden on service modeler) Only as a last resort: 3. Determine an (OData-proprietary) approach to encode all valid Unicode characters in ATOM, e.g. encode backspace as: {U+0009} (That is, eight separate characters indicating a Unicode HEX value).

      Description

      OData CSDL spec states that Edm.String is a "Sequence of UTF-8 characters". However some characters (e.g. ASCII control characters < 32 other than tab, newline, carriage return) are not valid in XML 1.0 (all except NUL are valid in XML 1.1 by the way).

      So there are some valid OData String characters not transmittable using ATOM.

      We ran into this recently with a client which was uploading a stack trace (from C#) that was the result of a client side exception (the client was attempting to create a "log record" entity at the server). The client's stack trace text contained a backspace character (which was actually the reason for the client's failure, so therefore it was important content).

      The client successfully uploaded this information to the server (a proxy) using JSON, then the proxy server tried to use XML to further upload that data to a backend server using XML, which failed due to XML 1.0 limitations (backspace not being transmissable).

      This would appear to indicate that ATOM (with XML 1.0) is not suitable for some legal values of type Edm.String. Even with XML 1.1, the NUL character is not transmissable.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              evan.ireland.2 Evan Ireland
            • Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated: