[vhffs-dev] [1045] Fixed UTF8 on users prefs.

[ Thread Index | Date Index | More vhffs.org/vhffs-dev Archives ]


Revision: 1045
Author:   gradator
Date:     2007-10-28 16:00:28 +0000 (Sun, 28 Oct 2007)

Log Message:
-----------
Fixed UTF8 on users prefs.

Modified Paths:
--------------
    trunk/vhffs-api/src/Vhffs/Panel/User.pm
    trunk/vhffs-panel/subscribe.pl


Modified: trunk/vhffs-api/src/Vhffs/Panel/User.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Panel/User.pm	2007-10-27 22:00:41 UTC (rev 1044)
+++ trunk/vhffs-api/src/Vhffs/Panel/User.pm	2007-10-28 16:00:28 UTC (rev 1045)
@@ -38,6 +38,8 @@
 use POSIX qw(locale_h);
 use locale;
 use Locale::gettext;
+use Encode;
+
 use Vhffs::User;
 use Vhffs::Main;
 use Vhffs::Panel::Main;
@@ -115,6 +117,8 @@
 
     while(my $u = $sth->fetchrow_hashref('NAME_lc')) {
         $u->{state} = Vhffs::Functions::status_string_from_status_id($u->{state});
+	$u->{firstname} = Encode::decode_utf8( $u->{firstname} );
+	$u->{lastname} = Encode::decode_utf8( $u->{lastname} );
         push(@$users, $u);
     }
     return $users;

Modified: trunk/vhffs-panel/subscribe.pl
===================================================================
--- trunk/vhffs-panel/subscribe.pl	2007-10-27 22:00:41 UTC (rev 1044)
+++ trunk/vhffs-panel/subscribe.pl	2007-10-28 16:00:28 UTC (rev 1045)
@@ -37,14 +37,15 @@
 # user and redisplay the form (already filled)
 #
 
+use strict;
 use utf8;
 use POSIX qw(locale_h);
 use CGI;
 use locale;
-use strict;
 use Locale::gettext;
 use HTML::Template;
 use Authen::Captcha;
+use Encode;
 
 use lib '%VHFFS_LIB_DIR%';
 use Vhffs::User;
@@ -92,12 +93,12 @@
     # get filled in parameters
     $mail       = $cgi->param( "MAIL" );
     $username   = $cgi->param( "USERNAME" );
-    $firstname  = $cgi->param( "FIRSTNAME");
-    $lastname   = $cgi->param( "LASTNAME" );
-    $city       = $cgi->param("CITY");
-    $zipcode    = $cgi->param("ZIPCODE");
-    $country    = $cgi->param("COUNTRY");
-    $address    = $cgi->param("ADDRESS");
+    $firstname  = Encode::decode_utf8( $cgi->param( "FIRSTNAME") );
+    $lastname   = Encode::decode_utf8( $cgi->param( "LASTNAME" ) );
+    $city       = Encode::decode_utf8( $cgi->param("CITY") );
+    $zipcode    = Encode::decode_utf8( $cgi->param("ZIPCODE") );
+    $country    = Encode::decode_utf8( $cgi->param("COUNTRY") );
+    $address    = Encode::decode_utf8( $cgi->param("ADDRESS") );
     $code       = $cgi->param("CONFIRMATION");
     $md5code    = $cgi->param("MD5_CODE");
 


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/