Version: (using KDE KDE 3.5.2) Installed from: Gentoo Packages I have a lot of PHP projects, some in utf8, some in 8859-1. If I forget to change the global editor setting in Kdevelop, I risk losing special chars in files when I save them. It's a *big* problem when that happens! The best solution would IMO be to be able to select charset in the project settings.
This is a nasty issue, and something we probably need to look at for KDE4/KDevelop4. The editor is a plugin, and today I'm not sure we can even affect its encoding setting from KDevelop.
You could use the .kateconfig file (which contains kate variables line) could provide that, or you could use the KTextEditor encodinginterface inside kdevelop if you wanted to implement it in code. The .kateconfig file is searched for in the current directory and in a configurable number of above directories, and would in your case contain something like kate: encoding iso8859-1; Read on here: http://drupal.kate-editor.org/article/.kateconfig For more about kate variables, contain the manual (http://docs.kde.org/stable/en/kdebase/kate/config-variables.html) or read the article at http://drupal.kate-editor.org/article/katepart_modelines -anders
Thanks for the info, Anders! A solution is implemented in KDevelop 3.4 branch: * Improved support for encodings # KDevelop will now obey the selected encoding in the File Open dialog # The OpenWith plugin now offers all available encodings in "Open As" # The encoding for each open file is saved with the session, and will be used to open that file the next time the project is loaded # Default encoding can be set per project in the Project Options - this will be the default when opening a file # File Open encoding will default to the open project's default
Thanks a lot, I appreciate your answers!
I would like to add an additional suggestion here. It would be very nice if Kate simply did not change sections of the current file which the user has not edited in that session, even if Kate is editing in Utf-8 mode and the file contains invalid Utf-8. Since Kate uses Utf-8 by default, the current solution is still likely to cause problems for people who do not pay too much attention (or who select "Edit with Kate" from the context menu in Konqueror!) and assume that Kate is 8-bit clean.
Or to put it another way, if Kate did not remove invalid Utf-8 from the file being edited unless the user explicitly deleted it using delete/backspace/whatever.
Michael, please open a bug report to KATE. The stuff you said has nothing to do with KDevelop.
I thought I already assigned this to kate earlier... For what its worth: Its close to impossible for kate to not alter invalid UTF-8 to make it valid, because else it couldn't open the file in the first place. IMHO its perfectly Ok to remove invalid UTF-8, else you might fall into much worse traps when doing something with that file with other tools. IMHO the real bug is in the application that produced the invalid UTF-8 in the first place.
Andreas, take a look at the original report, not the comments -- kate does not have much to do with it. It is really useful to set it once for good, that this project uses that encoding. How it could be done in kate? It knows nothing about KDevelop projects not mentioning appropriate configuration per project.
Absolutely right. Sorry for the noise, dunno what I was thinking (probably didn't read the title). Reassigning to kdevelop and removing kwrite-devel from the CC's.
Btw. is the status FIXED valid? In 3.4.1 I see no option for this in project options.
The status is valid, the option is on the General Page, at the bottom.