Improve validation of character encoding

XMLWordPrintable

      Presently we do not validate sufficiently the text field value where user types in character encoding. For example, if I use encoding="ISO8859-"1 and do an export of a space, then try to import it back into Confluence I get an error as described below:

      -customer's comment
      I am trying to import a personal space from 2.2.6a to a 2.2.7 test installation. I am receiving the following error message in 2.2.7 "Could not determine space key from contents of entities.xml" I do not understand why this is happening. I look forward to hearing back from you. thank you.

      UTF-8 works fine.

      However, if I just change the encoding to encoding="ISO-8859-1" (notice the '-' hyphen) the export and import work seamlessly.

      I tracked this down to : XMLDatabinder.java :: public void toGenericXML(Writer writer)
      Here the XML header is generated : writer.write("<?xml version=\"1.0\" encoding=\"" + encoding + "\"?>\n");

      This is not really validating the field. Perhaps this is not the right spot, yet it certainly should be validated before letting an user to type invalid encoding to be used in Confluence and then consequently causing problems later on.

              Assignee:
              Unassigned
              Reporter:
              Ivan Benko [Atlassian]
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: