Changeset 995

Show
Ignore:
Timestamp:
04/16/02 16:27:56 (11 years ago)
Author:
bradfitz
Message:

<lj user=avva>: This patch fixes an oversight: the view of all
subjects per month didn't auto-translate old entries. Note I don't
load all the props of all the posts to check unknown8bit=1. Instead I
just check if the subject is UTF-8, if not, I convert. This'll work in
99.99999% of cases and is much faster, so, considering this view never
lets the user edit anything, I think it's a good tradeoff.

Tested.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/htdocs/view/index.bml

    r857 r995  
    140140         $body .= "<dd><table cellpadding=2>"; 
    141141     } 
     142 
     143     # we need to convert the subject to UTF-8 if it's a pre-Unicode entry 
     144     # loading all the props for all the posts and checking 'unknown8bit'  
     145     # is too long. The heuristic "if it's not UTF-8, convert it" works 
     146     # well here. 
     147     if ($LJ::UNICODE && !LJ::is_utf8($subject)) { 
     148         my $error; 
     149         my $subj = LJ::text_convert($dbs, $subject, $u, \$error); 
     150         $subject = $subj unless $error; 
     151         LJ::text_out(\$subject); 
     152     } 
     153 
    142154     unless ($subject ne "") { $subject = "(no subject)"; } 
    143155     my $h = substr($eventtime, 11, 2);