Bug 172818 - protocol process crashed when opening a share containing folder names on a native language (russian)
Summary: protocol process crashed when opening a share containing folder names on a na...
Status: RESOLVED FIXED
Alias: None
Product: kio
Classification: Unmaintained
Component: smb (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR crash
Target Milestone: ---
Assignee: Unassigned bugs mailing-list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-10-14 20:06 UTC by Artem Bodrin
Modified: 2009-05-15 03:03 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Artem Bodrin 2008-10-14 20:06:36 UTC
Version:            (using KDE 4.1.2)
OS:                Linux
Installed from:    Compiled From Sources

kio_smb process crashes when opening a share, containing folders named with native language (russian in my case), or if a share itself is in russian. System locale is ru_RU.UTF-8, but I guess it's doesn't matter. An error is rised in internal data model for file/folder list when updating a cache. 
There is a cure:
source file kio_smb_internal.cpp; member void SMBUrl::updateCache():
you have to replace all four converts toLatin1() for toLocal8Bit().

So, the source
            if (KUrl::hasUser()) {
            surl += QUrl::fromPercentEncoding(KUrl::user().toLatin1());
            if (KUrl::hasPass()) {
                surl += ':' + QUrl::fromPercentEncoding(KUrl::pass().toLatin1());
            }
            surl += '@';
        }
        surl += QUrl::fromPercentEncoding(KUrl::host().toUpper().toLatin1());
        surl += QUrl::fromPercentEncoding(KUrl::path().toLatin1());

have to become:
if (KUrl::hasUser()) {
            surl += QUrl::fromPercentEncoding(KUrl::user().toLocal8Bit());
            if (KUrl::hasPass()) {
                surl += ':' + QUrl::fromPercentEncoding(KUrl::pass().toLocal8Bit());
            }
            surl += '@';
        }
        surl += QUrl::fromPercentEncoding(KUrl::host().toUpper().toLocal8Bit());
        surl += QUrl::fromPercentEncoding(KUrl::path().toLocal8Bit());

that's it...
I've done this for myself since release of kde 4.0.0 and tired a bit 8-))...
Comment 1 Yuri Chornoivan 2008-12-02 14:47:25 UTC
This bug was fixed in trunk. See commit 844753 by gamaral. But branch stands still broken.
Comment 2 Dario Andres 2009-05-15 03:03:58 UTC
And now branch is KDE4.2 already. Also, a lot of encoding bugs on SMB were fixed on KDE4.2 
I'm marking this as FIXED.
Thanks