Igor Gariev (gariev) wrote in changelog,
Igor Gariev
gariev
changelog

[livejournal] r17243: Removing error "Wide character in memGzi...

Committer: gariev
Removing error "Wide character in memGzip" while updating bio from XML (Unicode) sources
U   trunk/cgi-bin/LJ/SynSuck.pm
Modified: trunk/cgi-bin/LJ/SynSuck.pm
===================================================================
--- trunk/cgi-bin/LJ/SynSuck.pm	2010-08-31 20:20:51 UTC (rev 17242)
+++ trunk/cgi-bin/LJ/SynSuck.pm	2010-08-31 21:01:33 UTC (rev 17243)
@@ -8,6 +8,7 @@
 require "cleanhtml.pl";
 
 use LJ::TimeUtil;
+use Encode qw(encode_utf8 is_utf8);
 
 sub update_feed {
     my ($urow, $verbose) = @_;
@@ -412,8 +413,11 @@
         }
 
         my $bio = $su->bio;
-        $su->set_bio($feed->{'description'})
-            unless $bio && $bio =~ /\[LJ:KEEP\]/;
+        unless ($bio && $bio =~ /\[LJ:KEEP\]/) {
+            my $new_bio = $feed->{'description'};
+            $new_bio = encode_utf8($new_bio) if is_utf8($new_bio);
+            $su->set_bio($new_bio);
+        }
 
     }
 

Tags: gariev, livejournal, pm
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments