[Lxr-dev] [ lxr-Bugs-3204114 ] Display nicely non ISO-8859-1 trees
Brought to you by:
ajlittoz
From: SourceForge.net <no...@so...> - 2011-03-09 14:11:48
|
Bugs item #3204114, was opened at 2011-03-09 13:30 Message generated for change (Settings changed) made by ajlittoz You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=390117&aid=3204114&group_id=27350 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Browsing Group: current cvs Status: Open >Resolution: Works For Me Priority: 5 Private: No Submitted By: Andre-Littoz (ajlittoz) Assigned to: Nobody/Anonymous (nobody) Summary: Display nicely non ISO-8859-1 trees Initial Comment: LXR v0.9.8 LXR sends an HTTP header advertising for ISO-8859-1 content which is not always the case with Unicode becoming ubiquitous. This can be circumvented by creating a new tree-specific parameter for the charset to use with the tree. Its syntax is: 'encoding' => 'iso-8859-1' # default value in order not to disrupt LXR operation Instead of 'iso-8859-1', you can use any IANA defined charset. This involves patches in several files: 1- Common.pm In sub printhttp, send correct header: -448,448 110227 (replace line 448 with:) print("Content-Type: text/html; charset=", $config->{'encoding'}, "\n"); ---------------------- end of patch -------------------- In sub makeheader, add a variable substitution in case an HTML template wants to use 'encoding' for example in a <meta > tag: -852 110227 (insert after line 852:) 'encoding' => sub { return $config->{'encoding'}; }, --------------------- end of patch ------------------------ 2- Config.pm In sub initialize Make sure parameter 'encoding' has a reasonable default value -109 110227 (insert after line 109) $$self{'encoding'} = "iso-8859-1" unless (exists $self->{'encoding'}); ---------------------------- end of patch ----------------- 3- html-head.html With the introduction of the 'encoding' config parameter to advertise the character set used in the content, add the following line after <title>: -4 (insert after line 4) <meta http-equiv="content-type" content="text/html; charset=$encoding"> ---------------------- end of patch --------------------- ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=390117&aid=3204114&group_id=27350 |