Uploaded image for project: 'Sakai'
  1. Sakai
  2. SAK-38588

ResourceToolActionPipe.getContentstring() can incorrectly decode content.

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: CLOSED
    • Priority: Major
    • Resolution: Non-Issue
    • Affects Version/s: 2.6.x
    • Fix Version/s: None
    • Component/s: Kernel
    • Labels:
      None
    • Environment:
      Content on filesystem, UTF-8 MySQL database.
    • Previous Issue Keys:
      KNL-482

      Description

      Ok, so if you upload a HTML file to Sakai that is encoded as UTF-8. This file is stored and served up correctly. But if you don't have file.encoding=UTF-8 set (directly or indirectly) when you attempt to edit the file with the FCKeditor the content string gets encoded as HTML entities to be placed into the textarea, and when retrieving the content the platforms default character encoding is used to convert from a byte array to a string.

      In our case the JVM was defaulting to a file.encoding=US-ASCII, this then means that lots of the characters in a UTF-8 file can't be rendered.

      In org.sakaiproject.content.impl.BasicResourceToolActionPipe.getContentstring() there is a section of commented out code that forces all conversions to be done as UTF-8 which would have fixed the problem for us. As it stands we're actually switching the file.encoding to be UTF-8.

        Gliffy Diagrams

          Zeplin

            Attachments

              Issue Links

                Activity

                  People

                  Assignee:
                  buckett Matthew Buckett
                  Reporter:
                  buckett Matthew Buckett
                  Votes:
                  0 Vote for this issue
                  Watchers:
                  3 Start watching this issue

                    Dates

                    Created:
                    Updated:
                    Resolved:

                      Git Integration