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