Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. [Solved] How to convert url like string to unicode string?
Forum Updated to NodeBB v4.3 + New Features

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

Scheduled Pinned Locked Moved QML and Qt Quick
3 Posts 2 Posters 3.4k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    alex2202375
    wrote on last edited by
    #1

    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)

    1 Reply Last reply
    0
    • A Offline
      A Offline
      alex2202375
      wrote on last edited by
      #2

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

      1 Reply Last reply
      0
      • R Offline
        R Offline
        Robbin
        wrote on last edited by
        #3

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

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved