Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Newline, GPX, and cross-platform

    General and Desktop
    2
    3
    1171
    Loading More Posts
    • 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.
    • R
      rolandburt last edited by

      I am working on a Linux computer with Qt 5.xx. I want to write an XML file with my Linux computer but I need to use Windows newline characters. Is there any way to tell Qt to use Windows newlines when writing my XML file from a Linux computer? Probably something simple that I can't find in the docs?

      1 Reply Last reply Reply Quote 0
      • dheerendra
        dheerendra Qt Champions 2022 last edited by

        welcome to fourm. If you are planning to read/write using qt across the platform, you don't to worry much. You need to open the file using QIODevice::text mode. It will work according to local encoding. If you are file is ready by other software, you need to explicitly write windows format. I don't think there is direct way do dump like windows format.

        Dheerendra
        @Community Service
        Certified Qt Specialist
        http://www.pthinks.com

        1 Reply Last reply Reply Quote 0
        • R
          rolandburt last edited by

          My program writes good XML files with Linux newlines. For it to be readable by Windows, eg BaseCamp, sounds like I need to write a program that reads my XML file and writes one with Windows newlines, and then try to remember which ones have been "windowfied". and which ones still are Linux. This sounds like a dreadful kludge to me. As my Linux has no problem with using crlf terminated lines, I would like to generate only crlf lines.

          1 Reply Last reply Reply Quote 0
          • First post
            Last post