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. Problem in QtCreator with character "
Forum Updated to NodeBB v4.3 + New Features

Problem in QtCreator with character "

Scheduled Pinned Locked Moved General and Desktop
4 Posts 3 Posters 1.7k 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.
  • S Offline
    S Offline
    shalongbasi
    wrote on last edited by
    #1

    in Qtcreator for windows, I entered QHostAddress("192.168.1.1"), it compiled without any problem, but in the QtCreator under Ubuntu Linux, I entered the same thing and got compiler error message: stray "\302..." in program. I copied the code from windows to linux, and found when viewed in the editor inside QtCreator, " is shown differently, " copied from windows is longer then " entered directly under Linux. I donot know what causes the difference? how to fix it? thanks a lot

    1 Reply Last reply
    0
    • Q Offline
      Q Offline
      qxoz
      wrote on last edited by
      #2

      In what is difference. And if your project is not to big, can you post it? Then we could give a real advice.

      1 Reply Last reply
      0
      • S Offline
        S Offline
        shalongbasi
        wrote on last edited by
        #3

        I mean double quote mark " " entered under linux causing codes cannot be compiled.

        1 Reply Last reply
        0
        • C Offline
          C Offline
          ChrisW67
          wrote on last edited by
          #4

          If it compiled correctly then you did not type:
          @
          QHostAddress(“192.168.1.1”)
          @

          with so-called 'smart' quotes ("U+201F, U+201D":http://en.wikipedia.org/wiki/List_of_Unicode_characters#General_Punctuation etc) or the like, you must have typed:
          @
          QHostAddress("192.168.1.1")
          @

          with "straight" quotes (U+0022) which is what your compiler is expecting.

          The stray "\302" is indicative of a byte with hex value C2, part of a UTF-8 encoding for a character in the range "U+0080 to U+00BF":http://en.wikipedia.org/wiki/C1_Controls_and_Latin-1_Supplement being interpreted a a simple C-string without regard for its encoding. Exactly where the data is coming from or being mangled we cannot see.

          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