Bug 97660 - obey encoding stated in the file, e.g.: <?xml version="1.0" encoding="iso-8859-1"?>
Summary: obey encoding stated in the file, e.g.: <?xml version="1.0" encoding="iso-885...
Status: RESOLVED DUPLICATE of bug 55355
Alias: None
Product: kate
Classification: Applications
Component: kwrite (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR wishlist
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-01-22 16:35 UTC by S. Burmeister
Modified: 2005-03-24 12:18 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 S. Burmeister 2005-01-22 16:35:01 UTC
Version:            (using KDE KDE 3.3.91)
OS:                Linux

I run SuSE 9.2, so my default encoding is UTF-8.

When I open a website using kwrite (e.g. view source), the site is opened with encoding set to UTF-8, although the first line of the file clearly states:
<?xml version="1.0" encoding="iso-8859-1"?>

When I want to save that file, encoding is also set to UTF-8, which obviously would be wrong, since the file states that it is encoded in iso-8559-1.

Same for XML-documents. However here, kwrite should set the encoding to UTF-8, if no other encoding is stated in the file, as UTF-8 is the default encoding for XML-files.
Comment 1 Anders Lund 2005-01-22 17:08:38 UTC
It's a wish. A nice one, though, and we definitely need that.
In the mean time, we have a default encoding for XML set by using a file type.
Comment 2 Gilles Schintgen 2005-03-17 23:55:46 UTC
This wish also applies to LaTeX files, where the encoding is specified with a line like
\usepackage[utf8]{inputenc}
or
\usepackage[latin1]{inputenc}
etc.
Please have a look at http://home.imf.au.dk/burner/Manualer/TeX/inputenc.pdf for a complete list.
Comment 3 Thiago Macieira 2005-03-18 18:52:12 UTC
There should be a way for Konqueror to tell kwrite what encoding to use on open, since Konqueror does have an encoding detector.

I am not sure if this is Kate's job, but it might be interesting to provide the encoding-guesser feature.
Comment 4 Pavel Simerda 2005-03-18 19:54:50 UTC
On Friday 18 March 2005 18:52, Thiago Macieira wrote:
[bugs.kde.org quoted mail]
This could be quite useful
> I am not sure if this is Kate's job, but it might be interesting to provide
> the encoding-guesser feature.

I posted a long mail to the mailing list, writing about possible encoding 
detection/better_guess for kate (and kwrite).
I was going to implement (or participate on the implementation) of such a 
feature - especially for Unicode encodings (including utf-8 which I already 
have).
I am still wating for comments and revisions of what I posted as 'Text 
encoding detection'

Pavel
> _______________________________________________
> KWrite-Devel mailing list
> KWrite-Devel@kde.org
> https://mail.kde.org/mailman/listinfo/kwrite-devel

Comment 5 Christoph Cullmann 2005-03-24 12:18:03 UTC

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