Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Newline, GPX, and cross-platform
Forum Updated to NodeBB v4.3 + New Features

Newline, GPX, and cross-platform

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 1.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.
  • R Offline
    R Offline
    rolandburt
    wrote on last edited by
    #1

    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
    0
    • dheerendraD Offline
      dheerendraD Offline
      dheerendra
      Qt Champions 2022
      wrote on last edited by
      #2

      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
      0
      • R Offline
        R Offline
        rolandburt
        wrote on last edited by
        #3

        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
        0

        • Login

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