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

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

              Created:
              Updated:
              Resolved: