Uploaded image for project: 'translate5'
  1. translate5
  2. TRANSLATE-2453

Fix unescaped control characters in language resource answers

    • High
    • Solving the the following error coming from OpenTM2: ERROR in editor.languageresource.service.connector: E1315 - JSON decode error: Control character error, possibly incorrectly encoded

      problem

      Some language resources (mainly OpenTM2) were returning a JSON which contains unescaped unicode characters. So if the raw content was containing a control character this was crashing the JSON decode with the following exception:

      ERROR in editor.languageresource.service.connector: E1315 - JSON decode error: Control character error, possibly incorrectly encoded

      Exception: editor_Services_Exceptions_InvalidResponse
      Level: ERROR
      Errorcode: E1315
      Message: JSON decode error: Control character error, possibly incorrectly encoded
      Domain: editor.languageresource.service.connector
      Version: 5.0.15
      File (Line): [...]/application/modules/editor/Services/Connector/HttpApiAbstract.php (142)

      This is fixed now by catching the control character error, try to encode control characters and decode the whole JSON again.

          [TRANSLATE-2453] Fix unescaped control characters in language resource answers

          Marc Mittag [Administrator] made changes -
          Start Date [Gantt] New: 23/Apr/24 5:00 AM
          Aleksandar Mitrev made changes -
          Status Original: Final pull request made [ 10005 ] New: Done [ 10000 ]
          Marc Mittag [Administrator] made changes -
          Workflow Original: MittagQI Workflow [ 30918 ] New: MittagQI Workflow with Peer [ 36510 ]
          Thomas Lauria made changes -
          Resolution New: Fixed [ 1 ]
          Status Original: In Progress [ 3 ] New: Test Ready [ 10005 ]
          Thomas Lauria made changes -
          Status Original: Selected for Development [ 10100 ] New: In Progress [ 3 ]
          Thomas Lauria made changes -
          Status Original: Open [ 10002 ] New: Selected for Development [ 10100 ]
          Thomas Lauria created issue -

            tlauria Thomas Lauria
            tlauria Thomas Lauria
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: