Uploaded image for project: 'Offre de formation'
  1. Offre de formation
  2. ODF-683

Import Apogée : Caractères unicode non filtré

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • 1.3.2, 2.0.1
    • 1.3.2
    • None
    • None

      Dans les champs de la table ELEMENT_ADD

      on trouve des caractères : \u0001, \u0002

      cela bloque l'édition de la formation, à cause de l'erreur :

      Character reference "&amp;amp;#1" is an invalid XML character.</message><stacktrace>org.xml.sax.SAXParseException: Character reference "&amp;amp;#1" is an invalid XML character.
      	at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
      	at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source)
      	at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
      	at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
      	at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
      	at org.apache.xerces.impl.XMLScanner.reportFatalError(Unknown Source)
      	at org.apache.xerces.impl.XMLScanner.scanCharReferenceValue(Unknown Source)
      	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanCharReference(Unknown Source)
      	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
      	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
      	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
      	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
      	at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
      	at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
      	at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
      	at org.apache.excalibur.xml.impl.JaxpParser.parse(JaxpParser.java:315)
      	at org.apache.excalibur.xml.impl.JaxpParser.parse(JaxpParser.java:334)
      	at org.ametys.runtime.plugins.core.dispatcher.DispatchGenerator._dispatching(DispatchGenerator.java:133)
      	at org.ametys.runtime.plugins.core.dispatcher.DispatchGenerator.generate(DispatchGenerator.java:81)
      

          [ODF-683] Import Apogée : Caractères unicode non filtré

          Ok j'ai remplacé par : CharMatcher.JAVA_ISO_CONTROL.and(CharMatcher.anyOf("\r\n\t").negate()).removeFrom(strValue).
          En espérant que çà marche ..

          Laurence Aumeunier added a comment - Ok j'ai remplacé par : CharMatcher.JAVA_ISO_CONTROL.and(CharMatcher.anyOf("\r\n\t").negate()).removeFrom(strValue) . En espérant que çà marche ..

          Avec juste JAVA_ISO_CONTROL, on va filtrer tous les caractères de contrôle, y compris CR, LF et tabulation.
          Je pense qu'il faudrait utiliser une expression du style CharMatcher.JAVA_ISO_CONTROL.and(CharMatcher.anyOf("\r\n\t").negate()) pour dire "les caractères de contrôle sauf \r, \n et \t".

          Nicolas Gavalda (Inactive) added a comment - Avec juste JAVA_ISO_CONTROL, on va filtrer tous les caractères de contrôle, y compris CR, LF et tabulation. Je pense qu'il faudrait utiliser une expression du style CharMatcher.JAVA_ISO_CONTROL.and(CharMatcher.anyOf("\r\n\t").negate()) pour dire "les caractères de contrôle sauf \r, \n et \t".

          I use CharMatcher.JAVA_ISO_CONTROL.removeFrom(value) but I was unable to test ...
          Please reopen this issue if this doesn't fix it

          Laurence Aumeunier added a comment - I use CharMatcher.JAVA_ISO_CONTROL.removeFrom(value) but I was unable to test ... Please reopen this issue if this doesn't fix it

          Enlever les caractères de contrôle mais éviter d'enlever les tabulations, CR et LF.
          Cela doit pouvoir se faire par replaceAll avec les regex \p{Cntrl} et \p{Space} ou avec le CharMatcher de guava.

          Nicolas Gavalda (Inactive) added a comment - Enlever les caractères de contrôle mais éviter d'enlever les tabulations, CR et LF. Cela doit pouvoir se faire par replaceAll avec les regex \p{Cntrl} et \p{Space} ou avec le CharMatcher de guava .

          Echapper ou ignorer ou remplacer par rien, tous les caractères de contrôle entre 0 et 32 à l'import
          (il existe peutetre une méthode dans stringUtils ?)

          Delphine Gavalda (Inactive) added a comment - Echapper ou ignorer ou remplacer par rien, tous les caractères de contrôle entre 0 et 32 à l'import (il existe peutetre une méthode dans stringUtils ?)

            laurence Laurence Aumeunier
            delphine Delphine Gavalda (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: