Incorrect encoding of file names, directories ...in the search box.
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
DC++ |
Fix Released
|
Low
|
Unassigned | ||
LinuxDC++ |
Confirmed
|
Medium
|
Unassigned |
Bug Description
The problem with the coding in the search box if the user is connected to a hub such as the external IP address, and I'm on the inside then the function
ClientManager:
returns the system encoding, and encoding CP1251 hub as a result of the search box in the file names, paths, nicknames does not display correctly.
void SearchManager:: onData (const uint8_t * buf, size_t aLen, const string & remoteIp) {
..........
string hubIpPort = x.substr(i, j-i);
string url = ClientManager:
string encoding = ClientManager:
nick = Text:: toUtf8 (nick, encoding);
file = Text:: toUtf8 (file, encoding);
hubName = Text:: toUtf8 (hubName, encoding);
...........
SearchResultPtr sr (new SearchResult (user, type, _slots, freeSlots, size,
file, hubName, url, remoteIp, TTHValue (tth), Util:: emptyString));
fire (SearchManagerL
...........
}
Forgive me, I used google translate
While I understand the logic of what you're saying, I don't understand what would cause this. In what situations would you get a search result with ClientManager: :getInstance( )->findHub( hubIpPort) returning an empty url for it? The hub:ip is required in the $SR and findHub() iterates over all of the available hubs you are connected to. The only situation I can see is if you got a search result from a hub (if passive) or user (if active) after leaving the hub you initiated the search from. However, in that case you wouldn't want the search result anyway since you're not in the hub to download it.