Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-23741

Handle accentued characters in nuxeo.conf

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 7.10, 8.10
    • Fix Version/s: 10.2
    • Tags:
    • Backlog priority:
      400
    • Sprint:
      nxAI Sprint 10.2.1

      Description

      If a property in nuxeo.conf used an accentued character, it is wrongly encoded in the target XML file.

      For example, add the following line in nuxeo.conf

      nuxeo.notification.eMailSubjectPrefix=Nuxéo

      It will produce this line in nxserver/config/notification-config.xml after running the command nuxeoctl configure

            <eMailSubjectPrefix>Nuxéo </eMailSubjectPrefix>
      

      The expected result is

            <eMailSubjectPrefix>Nuxéo</eMailSubjectPrefix>
      

        Attachments

          Activity

          Hide
          pcardoso Pedro Cardoso added a comment -

          We are using a java.util.Properties class to read nuxeo.conf.
          This class takes as input to the load() method a file in Latin-1 encoding (https://docs.oracle.com/javase/8/docs/api/java/util/Properties.html)

          Reads a property list (key and element pairs) from the input byte stream. The input stream is in a simple line-oriented format as specified in load(Reader) and is assumed to use the ISO 8859-1 character encoding; that is each byte is one Latin1 character. Characters not in Latin1, and certain special characters, are represented in keys and elements using Unicode escapes as defined in section 3.3 of The Java™ Language Specification.

          There are some inputs that one can circumvent this by using a InputStreamReader object instead of an InputStream object : https://stackoverflow.com/questions/863838/java-properties-utf-8-encoding-in-eclipse

          Moving with this approach

          Show
          pcardoso Pedro Cardoso added a comment - We are using a java.util.Properties class to read nuxeo.conf. This class takes as input to the load() method a file in Latin-1 encoding ( https://docs.oracle.com/javase/8/docs/api/java/util/Properties.html ) Reads a property list (key and element pairs) from the input byte stream. The input stream is in a simple line-oriented format as specified in load(Reader) and is assumed to use the ISO 8859-1 character encoding; that is each byte is one Latin1 character. Characters not in Latin1, and certain special characters, are represented in keys and elements using Unicode escapes as defined in section 3.3 of The Java™ Language Specification. There are some inputs that one can circumvent this by using a InputStreamReader object instead of an InputStream object : https://stackoverflow.com/questions/863838/java-properties-utf-8-encoding-in-eclipse Moving with this approach
          Hide
          pcardoso Pedro Cardoso added a comment -

          From now, all stored xml files will be saved in UTF-8.
          For the input nuxeo.conf file, we check the codepage and open with the respective codepage. The possibilities are : ASCII, UTF-8, Latin-1

          Show
          pcardoso Pedro Cardoso added a comment - From now, all stored xml files will be saved in UTF-8. For the input nuxeo.conf file, we check the codepage and open with the respective codepage. The possibilities are : ASCII, UTF-8, Latin-1
          Hide
          pcardoso Pedro Cardoso added a comment -

          Merged into master. Back porting to older versions.

          Show
          pcardoso Pedro Cardoso added a comment - Merged into master. Back porting to older versions.
          Hide
          hudson Jenkins added a comment -

          SUCCESS: Integrated in master/nuxeo-master #1623
          NXP-23741: Change file reading (nuxeo.conf) and templates writing write (pcardoso: 52b136b8a5124f41551fa9238d8203b37d11af8c)

          Show
          hudson Jenkins added a comment - SUCCESS: Integrated in master/nuxeo-master #1623 NXP-23741 : Change file reading (nuxeo.conf) and templates writing write (pcardoso: 52b136b8a5124f41551fa9238d8203b37d11af8c )

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 week
                1w