Comment 2 for bug 489670

Revision history for this message
NoSFeRaTU (master-nosferatu) wrote :

I have same issues with broken cp1251 codepage on my hub, other hubs are unaffected. After some researching i found out that reason of that behavior in core lib, especially in find hub algorithm which not supported "multihome" hubs. If search result received from user which connected through another hub`s ip then findHub function failed because ips not equal, then fails FindHubEncoding function (which uses findHub function result as parameter) and fallback to "System charset", in my case it is UTF-8. After that Text::toUtf8 tries to convert nick,file,... from that system charset to utf-8 and completely destroyed all non-latin characters.

Some debug output for understanding:
NSFDEBUG:: SearchonData IP "", buf - "$SR [beeline]bazilio клипы\lordi Фрагмент 15.mp463809913 3/5TTH:TO3B7Q7OSQ4BXZWHA4WQPRPXZEUQKFFFW5UZLZQ (10.151.96.60 :411)", file "клипы\lordi Фрагмент 15.mp4"
NSFDEBUG:: findHub - ipPort - "10.151.96.60 :411", ip - "10.151.96.60 ", port - "411"
NSFDEBUG:: findHubForCycle - getIp - "10.1.1.100", ip - "10.151.96.60 ", getPort - "411", getHubUrl - "dc.ganjanetwork.org.ru"
NSFDEBUG:: findHubEncoding - Charset Not Equal, Skipping - "CP1251" because "dc.ganjanetwork.org.ru"!=""
NSFDEBUG:: findHubEncoding - Going to System Charset - "UTF-8"
NSFDEBUG:: SearchonData2 encoding "UTF-8", hubname "TTH:TO3B7Q7OSQ4BXZWHA4WQPRPXZEUQKFFFW5UZLZQ", nick - "[beeline]bazilio", file "\lordi 15.mp4"
NSFDEBUG:: SearchonData IP "", buf - "$SR [Citycomm]zamamam Видео\клипы 15/15TTH:GD22GA5SUUJAFCUXJIAL4AAAACZKKEQC6CNEUAA (172.31.47.1:411)", file "Видео\клипы\"
NSFDEBUG:: findHub - ipPort - "172.31.47.1:411", ip - "172.31.47.1", port - "411"
NSFDEBUG:: findHubForCycle - getIp - "10.1.1.100", ip - "172.31.47.1", getPort - "411", getHubUrl - "dc.ganjanetwork.org.ru"
NSFDEBUG:: findHubEncoding - Charset Not Equal, Skipping - "CP1251" because "dc.ganjanetwork.org.ru"!=""
NSFDEBUG:: findHubEncoding - Going to System Charset - "UTF-8"
NSFDEBUG:: SearchonData2 encoding "UTF-8", hubname "TTH:GD22GA5SUUJAFCUXJIAL4AAAACZKKEQC6CNEUAA", nick - "[Citycomm]zamamam", file "\\"