Bug report: Editor saves empty source code files
Posted: Sun Oct 21, 2012 11:32 am
When a source code file in the editor contains special unusual characters, an empty file will be written on the next file save action.
So your previous code file is overwritten with an empty file, but you can still see the code in the editor tab, if it is open.
This happens automatically when building or when you save the file by the save command, without any warning or message.
When building, the empty file is compiled to an object file without any code and data. When this is passed to the linker, it will not find the code and data and complain about undefined references.
CodeLite rev. 5770, wxWidgets 2.9.4
Global editor preferences: file font encoding: ISO-8859-1 (not UTF-8, because I use Windows API directly).
But I have to process UTF strings, too.
Sample (g++ console project):
The problem is caused by the UTF-8 in the comment, also would be with
Imo the expected behavior of the editor should be to treat the üß as usual ISO-8859-1 characters (my encoding setting).
As this obviously is a bug in wxWidgets, I think an additional check would be appropriate before CodeLite lets it write the file.
Thank you,
Fred
So your previous code file is overwritten with an empty file, but you can still see the code in the editor tab, if it is open.
This happens automatically when building or when you save the file by the save command, without any warning or message.
When building, the empty file is compiled to an object file without any code and data. When this is passed to the linker, it will not find the code and data and complain about undefined references.
CodeLite rev. 5770, wxWidgets 2.9.4
Global editor preferences: file font encoding: ISO-8859-1 (not UTF-8, because I use Windows API directly).
But I have to process UTF strings, too.
Sample (g++ console project):
Code: Select all
#include <stdio.h>
int main(int argc, char **argv)
{
printf("Grüße!\n"); // in UTF-8 "Grüße!"
return 0;
}
Code: Select all
const char* utf8Greetings = "Grüße!";
As this obviously is a bug in wxWidgets, I think an additional check would be appropriate before CodeLite lets it write the file.
Thank you,
Fred