[Solved] How to convert url like string to unicode string?



  • I am facing one problem when using gallery of Qt mobility.
    @
    DocumentGalleryModel {
    id: galleryModel
    rootType: DocumentGallery.Text
    properties: [ "fileName", "path", "filePath" ]
    sortProperties: [ "filePath" ]
    filter: GalleryFilterUnion {
    filters: [
    GalleryWildcardFilter {
    property: "fileName";
    value: ".TXT";
    },
    GalleryWildcardFilter {
    property: "fileName";
    value: "
    .txt";
    }
    ]
    }
    }@

    The returned fileName, filePath are encoded like @/home/user/MyDocs/Documents/Ebook/% E9% 97% B4% E5% AE% A2.txt@
    How can I convert those PercentEncoding strings to UTF-8 string?

    One more thing, if I use Text element to show the fileName, it could show it right(间客), but filePath just show the plaintext(/home/user/MyDocs/Documents/Ebook/% E9% 97% B4% E5% AE% A2.txt)



  • Got it worked, just need to use javascript function decodeURI(), this would decode the URI to string.



  • Could you please mark it as solved? Edit your post and add [Solved] in front. Thank you!


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.