Uploaded image for project: 'Cayenne'
  1. Cayenne
  2. CAY-792

Date has issues with different locales when using XMLEncoder/XMLDecoder

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.0
    • 3.0M1
    • Core Library
    • None
    • Problem was discovered when trying to encode data on a Linux machine and reading back on Windows with different locales.

    Description

      Date objects get encoded in this format when using the XMLEncoder (date.toString()):

      "EEE MMM dd HH:mm:ss zzz yyyy"

      which results in issues when trying to read back with the XMLDecoder under different locales. Even when using SimpleDateFormat with correct format string.

      I applied a patch which encodes/decodes dates in this format:

      "yyyy-MM-dd HH:mm:ss zzz"

      which works better with different locales.

      Attachments

        1. patch.txt
          2 kB
          Adrian Wiesmann

        Activity

          People

            andrus Andrus Adamchik
            awiesmann Adrian Wiesmann
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: