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

PlainTextPreviewer fallback to UTF-8 before raising exception

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 9.10, 10.1
    • Fix Version/s: 11.x
    • Component/s: Preview

      Description

      PlainTextPreview sometimes wrongly detects the character set of a text file.

      For example it can mistake a UTF-8 file for a IBM424_rtl.

      The preview then raises a UnsupportedEncodingException.

      Instead the PlainTextPreviewer.getPreview() method could catch UnsupportedEncodingException and fallback to UTF-8 encoding:
      https://github.com/nuxeo/nuxeo/blob/master/nuxeo-features/preview/nuxeo-preview-core/src/main/java/org/nuxeo/ecm/platform/preview/adapter/PlainTextPreviewer.java#L61

        Attachments

        1. test_Asset.txt
          0.0 kB
          Florent Guillaume

          Activity

            People

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

              Dates

              • Created:
                Updated: