×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Jun 2011
    Posts
    9

    Question symbian qml XmlListModel win1251

    Здравствуйте уважаемые.

    Собственно проблема в чтении русского rss c кодировкой вин 1251 выводятся кракозябры. (<?xml version="1.0" encoding="Windows-1251"?>)

    Не очень понимаю что надо сделать в этом случае. Подскажите в какую сторону копать.

  2. #2
    Nokia Developer Moderator
    Join Date
    Jan 2008
    Location
    Moscow, Russia
    Posts
    3,347

    Re: symbian qml XmlListModel win1251

    Конвертируйте полученный xml в utf8.

  3. #3
    Registered User
    Join Date
    Jun 2011
    Posts
    9

    Re: symbian qml XmlListModel win1251

    Quote Originally Posted by A.A.M. View Post
    Конвертируйте полученный xml в utf8.
    В qt я знаю куда pасунуть конвертирование. А в коде qml куда?

    XmlListModel {
    id: model

    property string feedUrl: "http://host"
    property bool loading: status == XmlListModel.Loading

    source: feedUrl
    query: "/rss/channel/item"
    XmlRole { name: "title"; query: "title/string()" }
    XmlRole { name: "description"; query: "description/string()" }
    XmlRole { name: "url"; query: "link/string()" }

    onStatusChanged: {
    if (status == XmlListModel.Ready) {
    // Util.log("FeedViewModel Status: ready")
    } else if (status == XmlListModel.Error) {
    // Util.log("FeedViewModel Status: error")
    } else if (status == XmlListModel.Loading) {
    // Util.log("FeedViewModel Status: loading")
    }
    }

    onFeedUrlChanged: {
    // Util.log("Feed url changed: "+feedUrl)
    }
    }
    Last edited by ivan.belousov; 2012-03-26 at 14:14.

  4. #4
    Nokia Developer Moderator
    Join Date
    Jan 2008
    Location
    Moscow, Russia
    Posts
    3,347

    Re: symbian qml XmlListModel win1251

    Можно совместно использовать Qt и QML код.
    Last edited by A.A.M.; 2012-03-27 at 06:28.

Similar Threads

  1. Searching in xmlListModel
    By Seikeau in forum [Archived] Qt Quick
    Replies: 1
    Last Post: 2011-11-14, 11:54
  2. XmlListModel: xml file not well formated
    By kdrozd in forum [Archived] Qt Quick
    Replies: 3
    Last Post: 2011-10-11, 15:17
  3. XmlListModel problem
    By bgenady in forum [Archived] Qt Quick
    Replies: 2
    Last Post: 2011-08-01, 06:51
  4. XmlListModel and setRawHeader
    By atonical in forum [Archived] Qt Quick
    Replies: 1
    Last Post: 2011-07-14, 07:04
  5. Problem with XMLListModel
    By manikantan in forum [Archived] Qt Quick
    Replies: 3
    Last Post: 2011-06-27, 16:43

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •