wrong display of non-ascii-characters in UTF-8-svg

Skip to first unread message


Mar 23, 2022, 12:00:24 PMMar 23
to Trac Users
I learned, that it is not a bug ( https://trac.edgewall.org/ticket/13471 ), so I hope someone can help us with the server configuration?

If I upload an svg file in UTF-8 encoding as an ticket attachment, containing Umlaute like ä, ö, ü, it diplays wrong characters for the umlaute.

Inside the ticket comment referencing the image, as well as on the attachment itself.

It seems not to be a problem of uploading, since on the server inside /env/files/attachments/ticket the svg is correctly, bitwise identical as I have uploaded it.

It is also not a question of my browser: If I open my original svg in Firefox, it displays correctly, if I open the one that trac delivers, either inside the ticket comment using the image, or directly under the raw-attachment/-URL or on the preview page under /attachment/ticket-URL, it fails. If I convert the svg from UTF-8 to ANSI and upload it, it works well. I already added svg to the trac.ini:

mime_map = text/x-dylan:dylan,text/x-idl:ice,text/x-ada:ads:adb,image/svg+xml:svg mime_map_patterns = text/plain:README(?!\.rst)|INSTALL(?!\.rst)|COPYING.*,image/svg+xml:.*svg

Thank You very much.


Mar 23, 2022, 3:34:58 PMMar 23
to Trac Users
Are you running TracStandalone, or Trac w/ Apache, Nginx, etc...? 


Mar 24, 2022, 9:08:22 AMMar 24
to Trac Users
With apache2 on a debian system.

Jun Omae

Mar 24, 2022, 9:20:48 AMMar 24
to trac-...@googlegroups.com
On Thu, Mar 24, 2022 at 10:08 PM Gauner <gau...@gmail.com> wrote:
> With apache2 on a debian system.

I consider the issue is caused by wrong server configurations and/or
wrong svg file.

- I don't have knowledge about Trac package with Apache in Debian system.
- Please provide Trac and Apache configurations.
- Are you using tracd with Apache, or mod_wsgi on Apache? Please
provide the detail of your apache.
- Please provide response headers for raw-attachment URL of the svg file
- Please share the svg file

Jun Omae <jun...@gmail.com> (大前 潤)


Mar 24, 2022, 11:39:38 AMMar 24
to Trac Users
Hey, thank You for looking at it.

After looking in the headers with curl, I saw that for the non working display environment:
   Content-Type: image/svg+xml; charset=iso-8859-15
is in, while on the working environment
   Content-Type: image/svg+xml; charset=utf-8
comes back.
Then I searched all apache .confs - nowhere is set anything like  AddDefaultCharset iso-8859-15 or AddCharset iso-8859-15
and even adding
   AddCharset utf-8 .svg
in the approbiate apache-trac.conf didn't have any effect.
Now I figured out, that there's a trac.ini setting:
   default_charset =  iso-8859-15
which has to go to
   default_charset = utf-8

With this all works well.

So, I appreciate all help I received, even though this time it was totally leading me in the wrong direction. ;-)
Reply all
Reply to author
0 new messages