Edgewall Software
Modify

Ticket #513 (closed defect: fixed)

Opened 8 years ago

Last modified 6 years ago

broken national characters while viewing the changeset

Reported by: tiger@… Owned by: jonas
Priority: highest Milestone: 0.8
Component: version control/changeset view Version: devel
Severity: critical Keywords:
Cc: tiger@…
Release Notes:
API Changes:

Description

We're running subversion repository server on linux (system's LANG=ru_RU.KOI8-R), while clients are on windows (codepage windows-1251).
Almost all sources in the repository contains characters in windows-1251 codepage.
Trac's repository browser shows sources in UTF-8 where national chars are broken (e.g. - unreadable)…
Seems it assumes that if the server's LANG is KOI8-R then sources are also KOI8-R and converts sources to UTF-8 from KOI8-R. This is wrong.
Is there a hack exists to tell Trac the encoding of the sources to be converted to UTF-8 from?

Attachments

Change History

comment:1 Changed 8 years ago by daniel

  • Milestone set to 0.8
  • Priority changed from normal to highest
  • Severity changed from normal to critical

comment:2 Changed 8 years ago by daniel+trac@…

My guess is that Trac should honour the svn:mime-type property and its charset parameter, which is how Subversion keeps track of charsets. Eg.:

svn propset svn:mime-type 'text/plain; charset=iso-8859-1' README

or in the above case,

svn propset svn:mime-type 'text/plain; charset=windows-1251' whatever

Trac should probably convert from that given charset to UTF-8 before displaying it to the browser. Currently, Trac seems to completely ignore the charset specified there, and always assume UTF-8.

comment:3 Changed 8 years ago by jonas

  • Status changed from new to assigned

Trac currently assumes the charset is utf-8 if it isn't iso-8859-1. Honoring charsets specified in the mime-type property is probably the way to go.

comment:4 Changed 8 years ago by jonas

  • Resolution set to fixed
  • Status changed from assigned to closed

Fixed in [801]. The new "default_charset" trac.ini option can be used to specify
default charset, see TracIni.

comment:5 Changed 8 years ago by tiger@…

  • Cc tiger@… added
  • Component changed from browser to changeset view
  • Resolution fixed deleted
  • Status changed from closed to reopened
  • Summary changed from broken national characters while viewing the sources to broken national characters while viewing the changeset
  • Version changed from 0.7.1 to devel

Changeset [801] closes the problem in the browser, but the same problem happily exists in the changeset viewer.

comment:6 Changed 8 years ago by jonas

  • Resolution set to fixed
  • Status changed from reopened to closed

Changeset.py now uses the same charset guessing behavoir as File.py.

View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
The resolution will be deleted. Next status will be 'reopened'
to The owner will be changed from jonas. Next status will be 'closed'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.