Uploaded image for project: 'Magnolia'
  1. Magnolia
  2. MAGNOLIA-255

Official support for UTF-8 in Magnolia

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Fixed
    • Major
    • 2.1 Final
    • 2.01
    • None
    • None

    Description

      There is a patch for UTF-8 and it would be good to incorporate it (IMHO officially into a future release:

      The following is copied from the magnolia-user mailing list from Dec 20, 2004:

      ______________
      Hi Dmitriy

      All is fine except :

      >After I fixed Tomcat and MultipartParser Magnolia admin pages started showing ??? in place of russian letters. I added
      >contentType="text/html;charset=UTF-8"

      I would rather use MIMEMappings under config/server , there you can set
      extension - html
      mime-type - text/html; charset=UTF-8
      this way you don't have to change any admin jsp's, content type will be set by the ContentType filter

      Regards,

      • Sameer

      __________original__________

      On Dec 20, 2004, at 4:43 PM, Дегтярев, Дмитрий В. wrote:

      Hello everybody,

      I just wanted to share some findings in the area of internationalization of Magnolia and Tomcat. Out-of-the box, Magnolia allows to enter international characters, but if you take a look at how this data gets stored you will see, that the upper byte gets removed, which means that real Unicode is not working. I ran into this problem when I tried to put some code into jsp template which pulls Russian strings from a database. All information from the database appeared corrupted (it did show two characters per letter on the screen). The problem was solved after I added

      contentType="text/html;charset=UTF-8"

      to all my JSP templates, but after that all russian letters which come from Magnolia appeared as ?, because it is stored incorrectly. I found out that something goes wrong when saving the data. When the browser sends request to the server, it should indicate the encoding it uses. I suspect the browser that I use (Firefox 1.0) does not do this, or may be XMLHttp object doesn't do this, anyway, I don't know. What I know, is that Tomcat doesn't know that the request is UTF-8, and defaults to ISO-8859-1. I found no other way to make Tomcat default to UTF-8 except rewrite its code. I also patched com.oreilly.servlet.multipart.MultipartParser which Magnolia uses to handle dialogs so it now defaults to UTF-8.

      After I fixed Tomcat and MultipartParser Magnolia admin pages started showing ??? in place of russian letters. I added

      contentType="text/html;charset=UTF-8"

      To all admin templates and now everything works.

      If somebody is interested in getting the patches please let me know.

      Regards,
      Dmitriy Degtiarev
      tgcp@mail.ru

      Checklists

        Acceptance criteria

        Attachments

          Activity

            People

              fgiust Fabrizio Giustina
              bladerunner Marc Oesch
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Checklists

                  Task DoD