Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. BOM and QtCreator, bug or not?

BOM and QtCreator, bug or not?

Scheduled Pinned Locked Moved Qt Creator and other tools
6 Posts 5 Posters 6.0k Views
  • 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.
  • V Offline
    V Offline
    vsorokin
    wrote on last edited by
    #1

    I use "QtScriptExtentions":http://doc.trolltech.com/4.7/qtscriptextensions.html in my application. And have problem:
    If in init.js of my extension I write russian text (UTF-8 encoding) then in application I see strange symbols instead of russian letters.
    This problem is only Windows system (not Linux).

    I add "BOM charachers":http://en.wikipedia.org/wiki/Byte_order_mark in my init.js with Hex editor help and problem disappear.
    But If I edit this file in Qt Creator again, BOM deleting.

    How you think, it's Qt Creator bug or not?

    --
    Vasiliy

    1 Reply Last reply
    0
    • T Offline
      T Offline
      tobias.hunger
      wrote on last edited by
      #2

      Which encoding is Qt Creator using? It defaults to whichever encoding the system is using and unfortunately Windows is still defaulting to codepages:-(

      1 Reply Last reply
      0
      • D Offline
        D Offline
        DenisKormalev
        wrote on last edited by
        #3

        Tobias, files editing is done in Linux (utf-8) and at Linux it works ok, but when you try to compile and run it at Windows wrong encoding is used. BOM helps with this problem, but QtCreator loses BOM if you try to edit file again (at Linux or Windows).

        1 Reply Last reply
        0
        • S Offline
          S Offline
          stukdev
          wrote on last edited by
          #4

          This is true, when i deploy a multilanguage program to linux and windows i become crazy for this :)
          Sometimes qtcreator say me that the file is locked and for editing i have to change the encode language.

          [quote author="Denis Kormalev" date="1292317409"]Tobias, files editing is done in Linux (utf-8) and at Linux it works ok, but when you try to compile and run it at Windows wrong encoding is used. BOM helps with this problem, but QtCreator loses BOM if you try to edit file again (at Linux or Windows).[/quote]

          1 Reply Last reply
          0
          • G Offline
            G Offline
            goetz
            wrote on last edited by
            #5

            We changed file encodings on all our development environment on all platforms to UTF-8 (Visual Studio and Qt Creator default settings - no more relying on the system default locale, all source files, etc.) and are happy without any problems. With that setup, no BOM are necessary for guessing the right encoding.

            For the C++ files there are some settings in the .pro file and the main function necessary, but that's not a big deal and is well documented.

            http://www.catb.org/~esr/faqs/smart-questions.html

            1 Reply Last reply
            0
            • T Offline
              T Offline
              tobias.hunger
              wrote on last edited by
              #6

              Denis: All this wold go away if microsoft would finally switch to unicode based encoding schemes by default. Mac and Linux are doing that for ages now and Windows does support it too (unicode is in there since Win 95 IIRC), it is just that they have not yet switched the default.

              A issue regarding BOM handling was recently fixed in the master branch of creator ("QTCREATORBUG-1857":http://bugreports.qt.nokia.com/browse/QTCREATORBUG-1857), maybe that fixes your BOM issue, too?

              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