Forum: AWStats stats file - keywords/keyphrases in other languages

 

« Back To Thread List

karamorf
3669 days ago
It seems for whatever reason AWStats decides to store other language search terms in a url encoded string. In order to prevent JAWStats then displaying a bunch of gibberish you need to call urldecode on line 129 in clsAwstats.php, so change this part of the line:
trim($aData[$iIndexItem][$iIndexAttr])
to this:
str_replace("&", "&", urldecode(trim($arrData[$iIndexItem][$iIndexAttr])))

Oh, the str_replace is because xml doesn't like bare &'s. Or if you would rather do it on the client side (reduce load for your server), edit js/jawstats.js in PopulateData_Keywords and Keyphrases. Then delete the .split("+")... stuff in each function and add in decodeURI(sWord) when its being pushed into the array. Also I highly suggest putting this in a try catch block, for me I found some cases the the php urldecode would convert into ??? characters but the decodeURI would cause a javascript error.

Eventually I'm going to have to look into how to fix this, I assume its from a search engine in some crazy language (or at least some crazy character encoding) that AWStats then has problems with. This becomes a hard problem to fix since I don't know the original language the text was entered in since it is just printed into the awstats log file.

« Back To Thread List

Participate in this discussion

 

You must be logged in to post in this thread.

 

Version 0.7 beta available now

Released 25th Janury 2009

Try the online demo or download now.

 
Latest JAWStats News:

Version 0.7 Beta Released

Sprechen Sie Deutsch? Multi-lingual JAWStats v0.7 is finally here.

posted 25th Jan '09. read more »
 

Help JAWStats

Please donate a dollar (or more!) towards the hosting costs for this site. This money doesn't go anywhere near my pocket, it is purely used against my hosting bill.

 

Get $50 off your webhosting

You could do far worse than choose Dreamhost. I've used them for 6 years and they're great. Simply enter the promo code: JAWSTATS on signup!