Uploaded image for project: 'Spring Web Services'
  1. Spring Web Services
  2. SWS-572

The default encoding is not set to UTF-8 for JibxMarshaller

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.5.8
    • Fix Version/s: 1.5.9
    • Component/s: OXM
    • Labels:
      None

      Description

      In the class "org.springframework.oxm.jibx.JibxMarshaller" the default encoding is not set to UTF-8 as specified in the Java-Doc of the method 'setEncoding()'.

      Therefore, when we marshal an object with "org.springframework.oxm.jibx.JibxMarshaller", the output XML does not contain the encoding attribute:

      <?xml version="1.0"?>

      instead of

      <?xml version="1.0" encoding="UTF-8"?>

        Activity

        Hide
        arjen.poutsma Arjen Poutsma added a comment -

        I am not sure what you mean. The default encoding for XML is UTF-8 (unless otherwise specified with a BOM), so

        <?xml version="1.0"?>

        is typically identical to

        <?xml version="1.0" encoding="UTF-8"?>

        Show
        arjen.poutsma Arjen Poutsma added a comment - I am not sure what you mean. The default encoding for XML is UTF-8 (unless otherwise specified with a BOM), so <? xml version = "1.0" ?> is typically identical to <? xml version = "1.0" encoding = "UTF-8" ?>
        Hide
        alex.arica@gmail.com Alexandre Arica added a comment -

        Hi Arjen,

        Well basically in the code of "JibxMarshaller" the private member "private String encoding;" is not explicitly set to UTF-8.
        If I set it specifically to UTF-8 using the setter 'setEncoding()' then the generated XML document contains: encoding="UTF-8" otherwise it does not.
        The default behaviour "JibxMarshaller" is therefore not what we expect.

        Cheers

        Show
        alex.arica@gmail.com Alexandre Arica added a comment - Hi Arjen, Well basically in the code of "JibxMarshaller" the private member "private String encoding;" is not explicitly set to UTF-8. If I set it specifically to UTF-8 using the setter 'setEncoding()' then the generated XML document contains: encoding="UTF-8" otherwise it does not. The default behaviour "JibxMarshaller" is therefore not what we expect. Cheers
        Hide
        alex.arica@gmail.com Alexandre Arica added a comment -

        For example, in the class "org.springframework.oxm.castor.CastorMarshaller", the default encoding is explicitly set to UTF-8 by default.

        Show
        alex.arica@gmail.com Alexandre Arica added a comment - For example, in the class "org.springframework.oxm.castor.CastorMarshaller", the default encoding is explicitly set to UTF-8 by default.
        Hide
        arjen.poutsma Arjen Poutsma added a comment -

        Closing old issues

        Show
        arjen.poutsma Arjen Poutsma added a comment - Closing old issues

          People

          • Assignee:
            arjen.poutsma Arjen Poutsma
            Reporter:
            alex.arica@gmail.com Alexandre Arica
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - 10m
              10m
              Remaining:
              Time Spent - 1m Remaining Estimate - 0.15h
              0.15h
              Logged:
              Time Spent - 1m Remaining Estimate - 0.15h
              1m