liuyuqi-dellpc 6 years ago
parent
commit
e3117066b7
2 changed files with 56 additions and 1 deletions
  1. 20 1
      README.md
  2. 36 0
      covert.php

+ 20 - 1
README.md

@@ -1,3 +1,22 @@
 # fix-teleport
 
-修复teleport软件中文爬取网站的错误。
+修复teleport软件中文爬取网站的错误。
+|
+查找 |
+| :--- |
+
+
+| | 替换 |
+| :--- | :--- |
+| /\\*tpa=.\*\\*/ | |
+| \btppabs="h\[^"\]\*"或者tppabs="h\[^"\]\*" | |
+| href="javascript:if\\(confirm\\('htt\[^"\]\*" | href=www.xxx.com |
+| href=" \*javascript:if\\(confirm\\('\(htt\[^"\s\]\*\).\*?" | href="$1" |
+| utf-8"utf-8" | utf-8 |
+| css文件: | |
+| tpa=http://\[^\s\]\*.gif | |
+| /\\*tpa.\*?\\*/ | |
+
+中文乱码,使用工具:
+
+[http://others.yoqi.me/convert.php](http://others.yoqi.me/convert.php)

+ 36 - 0
covert.php

@@ -0,0 +1,36 @@
+<?php
+//解决teleport 下载的中文文件名乱码
+//项目文件放在teleport文件夹
+//访问:http://others.yoqi.me/convert.php
+function listDir($dir)
+{
+	echo "start!";
+    if(is_dir($dir))
+    {
+        if ($dh = opendir($dir)) 
+        {
+            while (($file = readdir($dh)) !== false)
+            {
+                if((is_dir($dir."/".$file)) && $file!="." && $file!="..")
+                {
+                    rename($dir."/".$file,$dir."/".mb_convert_encoding($file,"GBK", "UTF-8"));
+                    listDir($dir."/".$file."/");
+                }
+                else
+                {
+                    if($file!="." && $file!="..")
+                    {
+                         rename($dir."/".$file,$dir."/".mb_convert_encoding($file,"GBK", "UTF-8"));
+						 echo $dir."/".$file;
+                    }
+                }
+            }
+            closedir($dh);
+        }
+    }
+	echo "finish!";
+}
+//开始运行
+listDir("E:/web/iis/teleport");
+
+?>