Bug 110707 - KTextEditor should try to guess encoding...
Summary: KTextEditor should try to guess encoding...
Status: RESOLVED DUPLICATE of bug 55355
Alias: None
Product: kate
Classification: Applications
Component: part (show other bugs)
Version: 0.2
Platform: Gentoo Packages Linux
: NOR wishlist
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-08-13 17:36 UTC by Mikkel Høgh
Modified: 2010-02-19 14:32 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mikkel Høgh 2005-08-13 17:36:37 UTC
Version:           3.4.1 (using KDE KDE 3.4.2)
Installed from:    Gentoo Packages
Compiler:          gcc version 3.3.5-20050130 CFLAGS/CXXFLAGS="-march=pentium4 -O2 -pipe -fomit-frame-pointer"
OS:                Linux

As I run a almost completely utf-8-based system, KTextEditor in Quanta thinks that everything is utf-8, and by default opens all files as such, but as I frequently have to deal with files in other encodings, it can become quite frustrating, because if you open a ISO-8859-1 HTML-file and save it as UTF-8, all non-ASCII chars are warbled into nonsense, with no warning what so ever.

I'm not asking that there should be a complicated checking-algorithm, but when a HTML-file starts like this:
<?xml version="1.0" encoding="iso-8859-15"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="da">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-15" />

there should be ample evidence as to which encoding to load this in...
So it would be nice if someone was to either show me a way to define which charset to load files as into the files ( abit like the # -*- coding: utf-8 -*- python uses), or implement a simple checker  that checks if there's a charset-definition in the file, and in case there is, loads the file as per the definition.
Comment 1 Jens Herden 2005-08-21 18:49:41 UTC
There are several solutions for this problem:
1. Quanta has a default encoding but you can specify another on in the file open dialog.
2. You can change the encoding after you opened the file with Tools|Encoding menu entry.
3. A project can have a different default encoding.
4. You can use Kate variables to inform the Kate part which encoding is to be used. See Kate's handbook about details.

But I agree Quanta could be a bit smarter here.
Comment 2 András Manţia 2005-08-21 18:54:15 UTC
On Sunday 21 August 2005 19:49, Jens Herden wrote:
> But I agree Quanta could be a bit smarter here.

How? I think Kate should be more smarter...
Comment 3 Mikkel Høgh 2005-08-21 20:43:11 UTC
#2: So the editor in Quanta is actually Kate?
In that case, the product of this bug should be changed :)
Comment 4 András Manţia 2005-08-21 22:02:39 UTC
Yes, it is the same editor as in Kate. It is called "katepart".
Comment 5 Anders Lund 2006-03-03 19:22:15 UTC
So, you leave it to us to find the *wish* this duplicates?
Comment 6 Dominik Haumann 2006-03-03 19:52:52 UTC
related to bug #55355 and #116777
Comment 7 András Manţia 2006-03-05 22:58:45 UTC
I did not know the Kate wishes or bugs, but it was clear that this was belongs to Kate, so I just reassigned. You can take as a report from somebody who did not verify for existing reports before filing a new one.
(Thanks Dominik for doing it though.)
Comment 8 Dominik Haumann 2010-02-19 14:32:34 UTC

*** This bug has been marked as a duplicate of bug 55355 ***