<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.kde.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugs.kde.org/"
          
          maintainer="sysadmin@kde.org"
>

    <bug>
          <bug_id>329454</bug_id>
          
          <creation_ts>2013-12-31 07:49:56 +0000</creation_ts>
          <short_desc>Kate ignores HTML character set declaration</short_desc>
          <delta_ts>2014-01-26 14:28:08 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>2</classification_id>
          <classification>Applications</classification>
          <product>kate</product>
          <component>encoding</component>
          <version>3.11.3</version>
          <rep_platform>openSUSE</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>NOR</priority>
          <bug_severity>minor</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>252168</blocked>
          <everconfirmed>0</everconfirmed>
          <reporter name="Christopher Yeleighton">giecrilj</reporter>
          <assigned_to name="KWrite Developers">kwrite-bugs-null</assigned_to>
          <cc>michal.humpula</cc>
          
          <cf_commitlink>http://commits.kde.org/ktexteditor/91e1030a512910d120175bf519c1662a35cff68c</cf_commitlink>
          <cf_versionfixedin></cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>0</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1421769</commentid>
    <comment_count>0</comment_count>
    <who name="Christopher Yeleighton">giecrilj</who>
    <bug_when>2013-12-31 07:49:56 +0000</bug_when>
    <thetext>Kate ignores HTML character set declaration, using ISO Latin-1 for all non-UTF content.

Reproducible: Always

Steps to Reproduce:
  1.  { cat &gt; /tmp/kate.html &lt;&lt;&apos;&lt;!-- EOF --&gt;&apos;; }
&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.01//EN&quot; 
&gt;&lt;HTML &gt;&lt;META HTTP-EQUIV=CONTENT-TYPE CONTENT=&quot;TEXT/HTML; CHARSET=ISO-8859-2&quot; 
&gt;&lt;TITLE &gt;Character set detection&lt;/TITLE &gt;&lt;P &gt;Zażółć gęślą jaźń
&lt;!-- EOF --&gt;

  2. Tell Kate to open &lt;URL: /tmp/kate.html &gt; using the default encoding (UTF–8).

Actual Results:  
  2. Kate figures out that the encoding is not UTF but uses ISO Latin-1:
&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.01//EN&quot; 
&gt;&lt;HTML &gt;&lt;META HTTP-EQUIV=CONTENT-TYPE CONTENT=&quot;TEXT/HTML; CHARSET=ISO-8859-2&quot; 
&gt;&lt;TITLE &gt;Character set detection&lt;/TITLE &gt;&lt;P &gt;Za¿ó³æ gê¶l± jaŒñ

Expected Results:  
  2. Let Kate use the encoding declared in the CONTENT-TYPE instead:
&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.01//EN&quot; 
&gt;&lt;HTML &gt;&lt;META HTTP-EQUIV=CONTENT-TYPE CONTENT=&quot;TEXT/HTML; CHARSET=ISO-8859-2&quot; 
&gt;&lt;TITLE &gt;Character set detection&lt;/TITLE &gt;&lt;P &gt;Zażółć gęślą jaźń

Of course, you can always tell Kate to use a different encoding, after the document has been opened (but before it is modified).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1421827</commentid>
    <comment_count>1</comment_count>
    <who name="Michal Humpula">michal.humpula</who>
    <bug_when>2013-12-31 12:40:20 +0000</bug_when>
    <thetext>I guess kate could use QTextCodec::codecForHtml when detecting text/html mime type.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1426987</commentid>
    <comment_count>2</comment_count>
    <who name="Christoph Cullmann">christoph</who>
    <bug_when>2014-01-26 14:28:08 +0000</bug_when>
    <thetext>Git commit 91e1030a512910d120175bf519c1662a35cff68c by Christoph Cullmann.
Committed on 26/01/2014 at 14:15.
Pushed by cullmann into branch &apos;master&apos;.

allow detection of encoding by HTML encoding

M  +19   -6    src/buffer/katetextloader.h

http://commits.kde.org/ktexteditor/91e1030a512910d120175bf519c1662a35cff68c</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>