Edgewall Software
Modify

Opened 12 years ago

Closed 12 years ago

#1842 closed defect (fixed)

mimetype renderer selection by mimetype fails with charset

Reported by: Shun-ichi Goto <gotoh@…> Owned by: Christopher Lenz
Priority: normal Milestone: 0.9
Component: version control/browser Version: devel
Severity: normal Keywords: mimeview php
Cc:
Release Notes:
API Changes:

Description

IHTMLPreviewRenderer.get_quality_ratio() takes 1 argument mimetype. All the implementation of get_quality_ratio() does not consider for charset attribute in mimetype (specified by svn:mime-type), like: "text/x-rst; charset=Shift_JIS". As result, expected renderer (i.e. ReStructuredTextRenderer) is not selected.

In case of above, "text/x-rst" should be passed to get_quality_ratio() instead of "text/x-rst; charset=Shift_JIS". Here is the simple patch:

--- api.py	(revision 2034)
+++ api.py	(working copy)
@@ -208,6 +208,7 @@
 
         if filename and not mimetype:
             mimetype = get_mimetype(filename)
+        mimetype = mimetype.split(';')[0].strip()
 
         candidates = []
         for renderer in self.renderers:

Attachments (0)

Change History (2)

comment:1 Changed 12 years ago by Christopher Lenz

Keywords: mimeview php added
Milestone: 0.9
Owner: changed from Jonas Borgström to Christopher Lenz
Status: newassigned

comment:2 Changed 12 years ago by Christopher Lenz

Resolution: fixed
Status: assignedclosed

Patch applied in [2051]. Thanks!

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Christopher Lenz.
The resolution will be deleted.
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.