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. Symbols in QMAKE_TARGET_COPYRIGHT?

Symbols in QMAKE_TARGET_COPYRIGHT?

Scheduled Pinned Locked Moved Solved General and Desktop
6 Posts 2 Posters 4.9k 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
    RogueWarrior
    wrote on last edited by
    #1

    Has anyone tried adding the copyright symbol to the QMAKE_TARGET_COPYRIGHT .pro value?
    On Windows, it only half works. You get the symbol but it's always preceded by a capital A with a little circle over it.
    Same thing happens if you try to use the registered trademark symbol in QMAKE_TARGET_PRODUCT.
    It all looks fine in Qt Creator so I don't know if it's a Windows bug or if it happens during the build.

    1 Reply Last reply
    0
    • Paul ColbyP Offline
      Paul ColbyP Offline
      Paul Colby
      wrote on last edited by
      #2

      @RogueWarrior said:

      Has anyone tried adding the copyright symbol to the QMAKE_TARGET_COPYRIGHT .pro value?

      At a quick glance, it would appear not (github search).

      However, it sounds like character encoding / misinterpretation issue.

      I'm guessing:

      • you've pasted the UTF-8 encoding for "COPYRIGHT SIGN" into your *.pro file
      • that character, in UTF-8, is the bytes 0xC2 and 0xA9
      • you're using a latin or ASCII charset in your *.rc file's StringFileInfo block(s)
      • those bytes in Latin-1 are "Capital A circumflex" (Â) and "Copyright sign" (©)

      You could either:

      • encode your *.pro file in ASCII (not sure what encoding(s) qmake officially supports for *.pro files, eg QTBUG-27896?); or
      • change your *.rc file's StringFileInfo block to use UTF-8 (unfortunately, I doubt this will work - MS appears to only support "Unicode", which is usually MS-speak for 16-bit chars); or
      • use some char-escape sequence in the *.pro file (does qmake support things like "\xA9"?)

      I can see why everyone else seems to have settled for "(c)".

      Cheers.

      1 Reply Last reply
      2
      • Paul ColbyP Offline
        Paul ColbyP Offline
        Paul Colby
        wrote on last edited by
        #3

        Just looking at the qmake source, the default RC file that qmake generates specified the Unicode charset (though the code doesn't actually guarantee that it's writing UCS-2 - it depends on the configured Windows locale).

        Are you using a default-generated RC file, or have you hand-written your own RC file? ie does your *.pro file specify either RC_FILE or RES_FILE?

        R 1 Reply Last reply
        0
        • Paul ColbyP Paul Colby

          Just looking at the qmake source, the default RC file that qmake generates specified the Unicode charset (though the code doesn't actually guarantee that it's writing UCS-2 - it depends on the configured Windows locale).

          Are you using a default-generated RC file, or have you hand-written your own RC file? ie does your *.pro file specify either RC_FILE or RES_FILE?

          R Offline
          R Offline
          RogueWarrior
          wrote on last edited by
          #4

          @Paul-Colby I just used the .pro file. Haven't tried messing with the .rc file yet.

          Paul ColbyP 1 Reply Last reply
          0
          • R RogueWarrior

            @Paul-Colby I just used the .pro file. Haven't tried messing with the .rc file yet.

            Paul ColbyP Offline
            Paul ColbyP Offline
            Paul Colby
            wrote on last edited by
            #5

            After a little more reading, its seems that your supposed to use the (magic?) "\251" sequence for the copyright symbol in Windows resource files. I see no official reference documentation for why that is, and no doubt it pre-dates Microsoft's Unicode support, but it is used in various Microsoft examples, such as https://msdn.microsoft.com/en-us/library/cc194812.aspx

            Note, using a platform-specific value like this would usually bother me, but QMAKE_TARGET_COPYRIGHT is a Windows only variable anyway, so it shouldn't be a problem? (if it did bother you, you could hand-bake your own *.rc file)

            Finally, here's some examples from Github of *.pro files using \251 - https://github.com/search?utf8=✓&q=QMAKE_TARGET_COPYRIGHT+AND+\251&type=Code&ref=searchresults but it essentially boils down to something like:

            QMAKE_TARGET_COPYRIGHT = "\\251 2016 All my code belongs to me"
            

            Cheers.

            1 Reply Last reply
            2
            • R Offline
              R Offline
              RogueWarrior
              wrote on last edited by
              #6

              Awesome! That works great. FYI, \256 is the magic incantation for the registered trademark symbol.

              1 Reply Last reply
              2

              • Login

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