Merge lp:~thumper/lazr.restful/encode-entryfieldresource-xhtml into lp:lazr.restful
Proposed by
Tim Penhey
Status: | Rejected |
---|---|
Rejected by: | Tim Penhey |
Proposed branch: | lp:~thumper/lazr.restful/encode-entryfieldresource-xhtml |
Merge into: | lp:lazr.restful |
Diff against target: |
12 lines (+1/-1) 1 file modified
src/lazr/restful/_resource.py (+1/-1) |
To merge this branch: | bzr merge lp:~thumper/lazr.restful/encode-entryfieldresource-xhtml |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Leonard Richardson (community) | Needs Fixing | ||
Review via email: mp+47500@code.launchpad.net |
Description of the change
If the XHTML representation for a single field is unicode, we should utf-8 encode it.
To post a comment you must log in.
Unmerged revisions
- 167. By Tim Penhey
-
Encode the EntryFieldResou
rce._representa tion if it is XHTML.
The XHTML representation for a field will not always be Unicode. It depends on the implementation of IFieldHTMLRenderer. In particular, the default renderer, render_ field_to_ html, returns UTF-8, and double-encoding it will cause an error. This might explain the errors you were seeing after making this change, but I'm not sure.
I think it's fine to move all the UTF-8 encoding out of the IFieldHTMLRenderer and make it the IFieldHTMLRende rer's responsibility to return Unicode. Alternatively, it would be easy to make EntryFieldResou rce._representa tion accept either and return UTF-8.
Here's my branch based on this one, which I think is better: https:/ /code.launchpad .net/~leonardr/ lazr.restful/ encode- xhtml-field