Results 1 to 2 of 2

Thread: Could not decode <filename> with "UTF-8"-encoding. Editing not possible

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jun 2011
    Location
    Porto Alegre, Brazil
    Posts
    482
    Thanks
    165
    Thanked 2 Times in 2 Posts
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Could not decode <filename> with "UTF-8"-encoding. Editing not possible

    Hello!

    Since some days ago a interesting problem appeared in my Qt Creator. Suddenly some files of some projects I created with my current Qt Creator and Qt library versions began to show the message in the title. That's funny, since this never happened before and my files should be in UTF-8. Some special characters of the codes were changed to an interrogation point (?), an another interesting thing that happened in the first day that this happened was that when I opened my Qt Creator, the background color of the editor was white while I always use it black and I didn't change the color recently.

    Looking for this problem on the Internet, I found some topics in forums dealing with it, but always the file had being corrupted due to some crash in the PC while executing Qt Creator or else the problem appeared when somebody had changed the development environment (e.g. moving from Linux to Mac), quite a different situation from mine. The greatest problem I noticed is that the only way that it seems possible to correct this problem is either creating a new project and copying the code to there (I did this with the first project where this problem appeared and not it's fine) or else using some other editor such as Notepad++ to save the files again in UTF-8, both actions that are unacceptable given the fact I have at least half a dozen of quite big Qt projects to do it.

    Could somebody gives me 1) an explanation of what could have happened given my specific case and 2) how can I solve this problem with a efficient way?


    Thanks,

    Momergil

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Could not decode <filename> with "UTF-8"-encoding. Editing not possible

    I am guessing the file name (not content) is encoded in a some local 8-bit form (Windows-1252, ÀÁõö÷øùúûüýþ ¿ and following char(s) perhaps?) that cannot possibly be interpreted as UTF8. I think only ÁÀõú would be part of the the Portuguese alphabet. You need to fix the encoding.

Similar Threads

  1. How to "detect" when editing a cell in QTableWidget ends?
    By dobedidoo in forum Qt Programming
    Replies: 1
    Last Post: 15th April 2011, 14:53
  2. Replies: 1
    Last Post: 7th April 2010, 22:46
  3. Replies: 3
    Last Post: 28th March 2009, 16:37
  4. Translation QFileDialog standart buttons ("Open"/"Save"/"Cancel")
    By victor.yacovlev in forum Qt Programming
    Replies: 4
    Last Post: 24th January 2008, 20:05
  5. QFile Problem~ "Unknow error" in "open(QIODevice::ReadWrite)"
    By fengtian.we in forum Qt Programming
    Replies: 3
    Last Post: 23rd May 2007, 16:58

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.