Edgewall Software
Modify

Opened 20 years ago

Closed 18 years ago

#1457 closed defect (fixed)

Changeset contents doesn't encoded to UTF8

Reported by: anonymous Owned by: Christopher Lenz
Priority: normal Milestone: 0.9
Component: version control/changeset view Version: devel
Severity: minor Keywords: changeset charset encoding
Cc: vyt@… Branch:
Release Notes:
API Changes:
Internal Changes:

Description

I use trac trunk from 21 april 2005.

In changeset html output (and in diff format) content doesn't encoded to UTF8 as it does in browser module.

Attachments (1)

trac.changeset_content_encoding.patch (2.6 KB ) - added by vyt@… 20 years ago.
Patch for correct encoding in changeset content

Download all attachments as: .zip

Change History (16)

comment:1 by anonymous, 20 years ago

Milestone: 0.9
Owner: changed from Jonas Borgström to Christopher Lenz

comment:2 by anonymous, 20 years ago

BTW, Changeset.py also should check for DISP_MAX_FILE_SIZE in html output (not in diff format).

comment:3 by Christopher Lenz, 20 years ago

Resolution: fixed
Status: newclosed

Fixed in [1660].

(I don't think there's a good way we can limit the size of the diff HTML output at this point.)

comment:4 by vyt@…, 20 years ago

Thank you very much!

comment:5 by vyt@…, 20 years ago

Resolution: fixed
Status: closedreopened

I tried this changes and it doesn't work.

by vyt@…, 20 years ago

Patch for correct encoding in changeset content

comment:6 by vyt@…, 20 years ago

Attached patch work for me. It also affect mimeview/api.py I think what charset detection should be common code for Trac.

comment:7 by Christopher Lenz, 20 years ago

Resolution: fixed
Status: reopenedclosed

Should be fixed in [1696].

comment:8 by vyt@…, 20 years ago

Yes, it works. But… It think what this code

charset = mimeview.get_charset(old_node.content_type) or default_charset
old_content = util.to_utf8(old_content, charset)

in many places in Trac could be simpler. Charset detection should be inside util.to_utf8().

comment:9 by Christopher Lenz, 20 years ago

We don't want to add a dependency between trac.util and the trac.versioncontrol layer. That's why I didn't apply your patch directly.

comment:10 by vyt@…, 20 years ago

In other words, mimeview.get_charset() will be different for different scm backends ?

comment:11 by Christopher Lenz, 20 years ago

No, the trac.mimeview package shouldn't know that the trac.versioncontrol package even exists. And get_charset should also work for things like attachments, of course.

comment:12 by anonymous, 18 years ago

Resolution: fixed
Status: closedreopened

This is still broken for me in 0.10.3.1. Here is a screenshot (sorry I can't provide access to the trac website directly):

http://www.mukund.org/tmp/bad-display.png

I have set the default encoding to utf-8, but it still shows bad characters instead of the actual UTF-8 in various languages (japanese, hindi, tamil, etc.). In other programs such as editors, and on the website (it's a web project), I get the actual UTF-8 displayed correctly.

comment:13 by anonymous, 18 years ago

Resolution: invalid
Status: reopenedclosed

Closing as invalid as this now works for me. Very very strange. Maybe the default encoding didn't take effect immediately. I have no idea how this started working again. As you can see from the screenshot, it was broken.

in reply to:  13 comment:14 by Christian Boos, 18 years ago

Resolution: invalid
Status: closedreopened

Replying to anonymous:

Maybe the default encoding didn't take effect immediately.

The change in the default encoding took effect immediately, but the changeset pages are cached by the browser. So the change in encoding was seen only after the page was forcibly reloaded or the diff options changed.

comment:15 by Christian Boos, 18 years ago

Resolution: fixed
Status: reopenedclosed

(re-closing as fixed)

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Christopher Lenz.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Christopher Lenz to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.