Version: 4.0.2 (using KDE 4.0.2) Installed from: Gentoo Packages If you set a rule for an encoding to open in a particular file with a particular extension: ~/.kde4.0/share/config/katemoderc for example it makes an entry: [Other/MY_RULE] Highlighting=None Highlighting Generated=false Highlighting Version= Mimetypes= Priority=0 Section= Variables=kate: encoding ibm866 Wildcards=*.THEEXTENSION This should open any file ending with .THEEXTENSION in ibm866. Kwrite seems to ignore this and open it in UTF-8 anyway, obviously not displaying the characters correctly. It will however show that ibm866 is selected in the menu if you got to check the encoding.
Created attachment 23865 [details] test.THEFILEEXTENSION Important, if the files open with ? in black circles, it's being opened in UTF-8 and not ibm866. gunzip the file before opening it.
Also note in the config above i used .THEEXTENSION and in the actual file i used .THEFILEEXTENSION you can make it anything you like.
Also for some reason the file i uploaded test.THEFILEEXTENSION.gz seems to be called attachment.cgi when you download it from this bug. Simply rename it to test.THEFILEEXTENSION.gz when it's on your desktop. I gzipped it to preserve it's encoding.
Confirmed, I tried it with KWrite 3.5 and it works (config is saved in katefiletyperc and correctly read and set) while in KWrite 4, config is correctly written in katemoderc, the encoding is set in the Encoding menu (Tools -> Encoding) but the file opens as UTF-8.
"but the file opens as UTF-8." But it has a tick next to IBM866, so it looks like it's reading the config but just ignoring it anyway.
1. Bug 161777 seems to be a duplication of this one. 2. In my own environment, not only kwrite or kate has this problem, even konqueror has the same problem in KDE4. When I used konqueror to open a (local) web page, I can not change the viewing encoding either. My environment: KDE 4.0.4 installed from Mandriva 2008.1 backports. locale: zh_TW.UTF-8.
ad.1) not at all, setting from Konqueror should be accepted in Kate, note that the settings should be set just for current file (manually), so nothing is written to the disk as configuration file
related bug for .kateconfig file: bug #125974 related bug for kate modelines : bug #187033
Bug is still valid for KDE 4.3.2 (Kubuntu 9.10). As mentioned in comment #4 KWrite from KDE 3.5 did support this feature.
I've noticed this has change, slightly. Using KDE 4.5.2 it's only screwed up the first time you open the file if you close it again and reopen it, it'll work fine.
the encoding: xxx variable is removed for KDE 4.8, it does simply not work and we have no manpower to implement that correctly