Edgewall Software
Modify

Opened 11 years ago

Last modified 8 years ago

#10950 new defect

[hg] encoding setting is not used for files in hg

Reported by: soloman@… Owned by:
Priority: normal Milestone: plugin - mercurial
Component: plugin/mercurial Version: 1.0dev
Severity: normal Keywords: file multiple encodings
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

We have some files in UTF-8 and some files in cp1251 in our mercurial repository.

[hg] encoding = utf-8, cp1251

With this setting committer, commit message, etc are displayed correct in trac's source browser. Files in UTF-8 are also displayed correct, but not files in cp1251.

Attached patch adds encoding conversion for file content according to [hg] encoding setting.

Attachments (1)

file_encoding.diff (503 bytes ) - added by soloman@… 11 years ago.
encode files from hg according to [hg] encoding setting

Download all attachments as: .zip

Change History (4)

by soloman@…, 11 years ago

Attachment: file_encoding.diff added

encode files from hg according to [hg] encoding setting

comment:1 by soloman@…, 11 years ago

Milestone: 1.0.1plugin - mercurial

comment:2 by Christian Boos, 11 years ago

Well, that to_u won't work here: what about binary files? (e.g. images).

in reply to:  2 comment:3 by soloman@…, 11 years ago

Replying to cboos:

Well, that to_u won't work here: what about binary files? (e.g. images).

Added an .xls sheet and .png image. Both are not recognized by trac file viewer as text files and no error occurs.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The ticket will remain with no owner.
The ticket will be disowned.
as The resolution will be set. Next status will be 'closed'.
The owner will be changed from (none) to anonymous. Next status will be 'assigned'.

Add Comment


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