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)
Change History (16)
comment:1 by , 20 years ago
Milestone: | → 0.9 |
---|---|
Owner: | changed from | to
comment:2 by , 20 years ago
comment:3 by , 19 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
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:5 by , 19 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
I tried this changes and it doesn't work.
by , 19 years ago
Attachment: | trac.changeset_content_encoding.patch added |
---|
Patch for correct encoding in changeset content
comment:6 by , 19 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 , 19 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
Should be fixed in [1696].
comment:8 by , 19 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 , 19 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 , 19 years ago
In other words, mimeview.get_charset()
will be different for different scm backends ?
comment:11 by , 19 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 , 18 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
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.
follow-up: 14 comment:13 by , 18 years ago
Resolution: | → invalid |
---|---|
Status: | reopened → closed |
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.
comment:14 by , 18 years ago
Resolution: | invalid |
---|---|
Status: | closed → reopened |
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.
BTW, Changeset.py also should check for DISP_MAX_FILE_SIZE in html output (not in diff format).