Solve the garbled problem of referrers. The referrers system can display reverse links. Currently, the latest referer statistics on many sites use Stephen's referrer statistics system. The referrers system we will discuss today can display reverse links very well. Currently, the latest referer statistics on many sites use Stephen's referrer statistics system. What we want to discuss today is not its installation, but its character set garbled characters.
This software has a character set problem, this problem I want you to encounter, because my blog is a UTF-8 character, and a lot of domestic reverse links are GB2312, therefore, garbled characters are displayed in GB2312. It is very ugly, so it is necessary to unify character sets through technical means.
With the help of hedong, the problem was finally solved. It is actually using icov and Text-Iconv-1.2 to change GB2312 to UTF-8. The procedure is as follows:
1. check whether the iconv software package is installed.
Iconv-V
If the iconv does not exist, install the glibc-common *. rpm package.
2. download the Text: Iconv module and install it.
Wget http://search.cpan.org/CPAN/authors/id/M/MP/MPIOTR/Text-Iconv-1.2.tar.gz
Tar zxvf Text-Iconv-1.2.tar.gz
Cd Text-Iconv-1.2
Perl Makefile. PL
Make
Make test
Make install
3. configure referrers. cgi (not many people are using it now ).
In use cgi (not many people are using it now) qw (: cgi (not many people are using it now)-lib); then add the following statement;
Use Text: Iconv;
My $ converter = Text: Iconv-> new ("GB2312", "UTF-8 ");
Add the following statement in the code # Print out the information:
If (index ($ durl, "baidu.com")>-1 | index ($ durl, "msnfans.com")>-1 | index ($ durl, "mybh.net")> -1 | index ($ durl, "hed
Ong.3322.org ")>-1 ){
$ Dtit = $ converter-> convert ($ dtit );
}
In the future, websites that need to convert character sets will be manually added.
If you are a UTF-8 passed GB2312 is similar
Thanks again for the help of hedong :)
Round (referer) statistics use Stephen's referrer statistics system. What we want to discuss today...