自定义脚本——Url中含中文转换

2 讨 论 426 浏览量 云采集引擎

采集过程中遇到URL链接中含有部分中文,导致采集内容页错误的时候,可能就是由于页面中的中文信息引起的

这里可以尝试使用自定义脚本将中文转换成编码形式

<?php
function CUSTOMFUN($inputstr){
// TODO: Coding Here
$outputstr = urlencode_ch($inputstr);
return $outputstr;
}
function urlencode_ch($str){     //直接用这个函数就可以了
    function callback($match){
        return urlencode($match[0]);
    }
    return preg_replace_callback('/[^\0-\127]+/','callback',$str);
    //正则表达式匹配非单字节字符(含中文)
}
echo CUSTOMFUN($PARASTR); // Not Allowed to Modify
?>

将上面的内容复制到自定义脚本当中就可以自动转换了 

2讨 论
已讨论 6月 20日 作者: prqcfmcax
<a href="https://aldactonefast.com/">aldactone 50 mg tablet</a>
<a href=https://aldactonefast.com/>side effects for aldactone </a>
https://aldactonefast.com - aldactone without an rx
<a href="https://allegrax.com/">allegra</a>
<a href=https://allegrax.com/>fexofenadine hcl </a>
https://allegrax.com - Generic Allegra
<a href="https://fastcymbalta.com/">duloxetine hcl</a>
<a href=https://fastcymbalta.com/>cymbalta withdrawal </a>
https://fastcymbalta.com - side effects for cymbalta
已讨论 7月 21日 作者: bqmsvrer
If this happens, it may be a sign of priapism and you should get medical help right away.I was afraid I'd find another one. <a href=https://superpillsx.com/>is tramadol addictive</a> , but mostly with products sold to poorer Indian communities and countries.Viagra was the first medicine in America to use oral in treating impotence.Here are more of the healthiest high-fact foods you should be eating.Sidney Wolfe, co-founder of the Public Citizen s Health Research Group, an advocacy group based in Washington. https://superpillsx.com/ - tramadol 50 mg for dogs How are they getting these drugs.Not inferior in quality, they cost almost 10 times cheaper than the originals.Avoid heavy and fatty meals - this means the tablet will take longer to absorb at a lower effect. https://xtadalafilx.com/ - tadalafil The breakdown and elimination of tadalafil from the body may be decreased by erythromycin, ketoconazole Nizoral , itraconazole Sporanox , indinavir Crixivan and ritonavir Norvir.thick staidly female viagra herb an celluloid heighten the genic viagra from india plodded frontward the coronate to rehouse levitra generic viagra in unspoilt elevated for the moderato chukaku-ha cannibalism.Considerably increases duration of sexual intercourse. <a href=https://cialismans.com/>tadalafil cialis</a> I would go see a doctor, an internist, urologist whoever you have a relationship with would be the best.How did they come up with the name VIAGRA. https://wowcialisnow.com/ - buy cialis If we compare the drugs Idagra and Cialis, the statistics say that the first option is much less likely to cause negative consequences of taking tablets.Over time, Viagra began to appear analogues, including natural origin, but today it is still the most popular means with insufficient erection and allows men to get maximum pleasure from intimacy.And after I got the prescription I told her I had done that so that she would know.the lv angry slope. <a href="https://wowcialisnow.com/">generic cialis reviews</a> You suffer from long-term impotence You do not suffer from side effects.Текст песни First Be a Woman.The effect is there. <a href=https://webmedicxxx.com/>viagra 100mg</a> During this period, the number of cecual contacts can be significantly increased compared to the standard practice of cec.You should not use Viagra if you are allergic to sildenafil, or.388 mg, croscarmellotosis sodium - 30 mg, magna stearate - 12 mg. https://doctormedweb.com/ - generic viagra

Finndy Copyright©2017 | Powered by Q2A

...