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

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>17873</bug_id>
          
          <creation_ts>2008-03-15 23:46:56 -0700</creation_ts>
          <short_desc>Encoding override should not be persistent</short_desc>
          <delta_ts>2017-07-18 08:29:32 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Page Loading</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Mac</rep_platform>
          <op_sys>OS X 10.5</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="johnnyding">johnnyding.webkit</reporter>
          <assigned_to name="Jungshik Shin">jshin</assigned_to>
          <cc>ap</cc>
    
    <cc>darin</cc>
    
    <cc>dglazkov</cc>
    
    <cc>ifette</cc>
    
    <cc>jshin</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>73871</commentid>
    <comment_count>0</comment_count>
    <who name="johnnyding">johnnyding.webkit</who>
    <bug_when>2008-03-15 23:46:56 -0700</bug_when>
    <thetext>Once you override the encoding for the current page by selecting one in View/Encoding menu, it is persistent and don&apos;t reset it when you go to a new page which explicitly specifies the encoding via HTTP or meta tag.

1. Go to zh.wikipedia.org (UTF-8 page)
2. Override the encoding to GBK. The page will be garbled. This is expected because it&apos;s forced to be interpreted as GBK although the page is in UTF-8.
3. Go to http://news.google.com/news?ned=cn (UTF-8 page)
4. The page should be interpreted as UTF-8, but is still interpreted as GBK.

IE and Firefox will reset the encoding override when visiting new page. 
The only difference between IE and Firefox is if users go to a new page in a sub-frame(in FRAME or IFRAME) instead of main frame, IE still resets the encoding override for the new page opened in sub-frame, but Firefox does not.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>73873</commentid>
    <comment_count>1</comment_count>
    <who name="johnnyding">johnnyding.webkit</who>
    <bug_when>2008-03-15 23:59:06 -0700</bug_when>
    <thetext>The encoding override functionality (in WebView::setCustomTextEncoding) calls FrameLoader::reloadAllowingStaleData to override encoding.  Since the FrameLoadType:FrameLoadTypeReloadAllowingStaleData is only used to reload current page by using user-selected encoding. So I think the easy way to fix his problem is

In DocumentLoader::overrideEncoding()
Check wthether current page&apos;s load type is reloadAllowingStaleData, If yes, then return right override encoding info, othervise return empty encoding.
In FrameLoader::void FrameLoader::load(const KURL&amp; newURL, const String&amp; referrer, FrameLoadType newLoadType,const String&amp; frameName, Event* event, PassRefPtr&lt;FormState&gt; formState)
Do not change the load type to FrameLoadTypeSame when load URL is same URL, but load type is reloadAllowingStaleData, then the child frame can get correct load type.

If WebKit want to follow FireFox way, do not reset the encoding override when new page is opened in child-frame. just need to check whether the load type of ancestor of the child-frame is FrameLoadTypeReloadAllowingStaleData or not.

A patch is coming soon</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>73876</commentid>
    <comment_count>2</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2008-03-16 01:50:37 -0700</bug_when>
    <thetext>Something we should not regress is navigating within a site that reports an incorrect encoding in its HTTP headers. For example, I&apos;m sometimes seeing sites that send their text as MacCyrillic when seeing &quot;Mac&quot; in our user agent string, but the headers incorrectly say &quot;macintosh&quot;, which is an alias of MacRoman.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>73880</commentid>
    <comment_count>3</comment_count>
    <who name="johnnyding">johnnyding.webkit</who>
    <bug_when>2008-03-16 04:14:41 -0700</bug_when>
    <thetext>I agree. That is why we have encoding override mechanism. 
I just think we should give user chance to look th page with original specified encoding when first time visiting a new page. But now in safari, once you specified a encoding override in one tab, then the tab would always use the specified encoding to decode all pages after that. That is incorrect.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>73881</commentid>
    <comment_count>4</comment_count>
      <attachid>19792</attachid>
    <who name="johnnyding">johnnyding.webkit</who>
    <bug_when>2008-03-16 04:27:04 -0700</bug_when>
    <thetext>Created attachment 19792
patch v1 for fixing this problem

For this patch, I have a link error in my local build in Mac Leopard. The following is detail info. Since I am not familiar with Object C programming. Would anyone please guide me if you know where is the problem. Thanks.

Undefined symbols:
  &quot;__ZNK7WebCore14DocumentLoader16overrideEncodingEv&quot;, referenced from:
      -[WebDataSource textEncodingName] in WebDataSource.o
      -[WebFrame(WebInternal) _receivedData:textEncodingName:] in WebFrame.o
      __ZN20WebFrameLoaderClient11createFrameERKN7WebCore4KURLERKNS0_6StringEPNS0_21HTMLFrameOwnerElementES6_bii in WebFrameLoaderClient.o
      -[WebView _mainFrameOverrideEncoding] in WebView.o
ld: symbol(s) not found</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>73882</commentid>
    <comment_count>5</comment_count>
      <attachid>19793</attachid>
    <who name="johnnyding">johnnyding.webkit</who>
    <bug_when>2008-03-16 05:06:28 -0700</bug_when>
    <thetext>Created attachment 19793
patch v2 for fixing this problem by using different way

Also if you think changing behavior of DocumentLoader::overrideEncoding is not good way. How about to call DocumentLoader::overrideEncoding(&quot;&quot;) in method FrameLoader::load when load type is not FrameLoadTypeReloadAllowingStaleData?  Please see my patch v2. It&apos;s different with patch v1.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>74022</commentid>
    <comment_count>6</comment_count>
      <attachid>19821</attachid>
    <who name="johnnyding">johnnyding.webkit</who>
    <bug_when>2008-03-16 20:19:32 -0700</bug_when>
    <thetext>Created attachment 19821
patch v2 for fixing this problem by using different way

update my pacth v2</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>74115</commentid>
    <comment_count>7</comment_count>
    <who name="Jungshik Shin">jshin</who>
    <bug_when>2008-03-17 10:49:42 -0700</bug_when>
    <thetext>(In reply to comment #2)
&gt; Something we should not regress is navigating within a site that reports an
&gt; incorrect encoding in its HTTP headers. 

Is there a reliable way to determine that new pages loaded are in the same site and they have the same problem as the page for which a user overrides the encoding?  
I guess the former is possible, but I&apos;m afraid it&apos;s hard to determine the latter. 

If what I&apos;m writing is the case, I guess it&apos;s better to be simple (to understand/explain) and predictable and to do what other browsers do. 

After all, those misconfigured sites need to correct themselves. And if they went extra length to convert their pages to  MacCyrillic (on the fly) ,   wouldn&apos;t they listen to a request for either  not doing it (just use the encoding they use for Windows) or using the correct charset name? 
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>74148</commentid>
    <comment_count>8</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2008-03-17 13:38:40 -0700</bug_when>
    <thetext>(In reply to comment #7)
&gt; After all, those misconfigured sites need to correct themselves. And if they
&gt; went extra length to convert their pages to  MacCyrillic (on the fly) ,  
&gt; wouldn&apos;t they listen to a request for either  not doing it (just use the
&gt; encoding they use for Windows) or using the correct charset name? 

Sadly, they don&apos;t listen.

This usually happens not because of conscious choice, but because of using poorly written &quot;localized&quot; Apache configs that people downloaded somewhere, or got with their Linux/FreeBSD distros.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>79112</commentid>
    <comment_count>9</comment_count>
      <attachid>19792</attachid>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2008-04-28 04:21:50 -0700</bug_when>
    <thetext>Comment on attachment 19792
patch v1 for fixing this problem

Clearing review flag, since this breaks the build. To fix the build, one could add __ZNK7WebCore14DocumentLoader16overrideEncodingEv to WebCore.exp, but I think that it would be better not to hide the tricky logic behind this innocent-looking function.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>79113</commentid>
    <comment_count>10</comment_count>
      <attachid>19821</attachid>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2008-04-28 04:46:38 -0700</bug_when>
    <thetext>Comment on attachment 19821
patch v2 for fixing this problem by using different way

As mentioned above, I do not have enough evidence to agree that the current behavior is broken from the user point of view. I was also going to say that we cannot change the semantics of -[WebView setCustomTextEncodingName:] API, but then I noticed that its own documentation (as well as a comment in WebView.h) says &quot;The text encoding automatically goes back to the default when the top level frame changes to a new location.&quot;

The difference seems to be too elaborate to be a simple bug. Perhaps there is a longer story behind this?

This patch as is breaks sites such as &lt;http://www.mdf.ru/&gt;, so I don&apos;t think that we want to take it. Firefox seems to have the same problem, although its charset auto-detection is very configurable, and it is possible that its ability to remember previously chosen overrides can remedy that in some cases.

There is certainly an issue to fix here, but I think that it would probably be appropriate to treat this as a documentation bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>109049</commentid>
    <comment_count>11</comment_count>
    <who name="Jungshik Shin">jshin</who>
    <bug_when>2009-02-09 15:55:44 -0800</bug_when>
    <thetext>Firefox does NOT have this issue. In both Firefox and IE, the manual encoding override is not persistent. I can&apos;t say about IE for sure, but as for Firefox, I can say for sure that  it&apos;s never been persistent but always has been applied ONLY to a single page being shown when a user manually overrides the encoding (needless to day, turning on/off and selecting an auto-encoding detector is persistent in Firefox). I also recently talked to a long-time Firefox I18N QA to make sure that&apos;s indeed the case and he confirmed it. 

You can try FF3 at www.mdf.ru (overrides the encoding to MacCyrillic on Mac at the front page and follow the link with the default encoding set to, say, ISO-8859-1 and
with the auto-detection turned off). 

You do have a point about sites like www.mdf.ru. If the site just used windows-1251 without encoding specified(the best would be for them to label the encoding correctly), Russian users even on Mac would be just happy by setting the default encoding to Windows-1251 because that&apos;s the encoding most likely for them to come across in the absence of an explicit encoding detection. 

Because www.mdf.ru emits MacCyrillic, it makes things complicated. Setting the default encoding to windows-1251 still breaks the site on Mac. In case of Firefox, turning on &apos;Russian&apos; encoding detector (even Universal detector works fine for MacCyrillic) kinda solves the issue without the encoding override persistency. ICU encoding detecotor (bug 16482) does not detect MacCyrillic so that fixing bug 16482 does not help in this case. 

Given all these, which would you like most, Alexey?

1. Make the manual encoding override NOT persistent as in Firefox
2a Make it persistent as long as a user stays in the &quot;same&quot; domain regardless of the encoding detection quality (I have a plan to improve or replace ICU encoding detector with a much better one).
2b same as #2a for now, but will take option #1 once we have an encoding detector on par with or better than that of Firefox. 





</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>109101</commentid>
    <comment_count>12</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2009-02-10 00:45:32 -0800</bug_when>
    <thetext>&gt; Firefox does NOT have this issue.

I meant, it doesn&apos;t work well with this site, in the same way that WebKit would if we took the patch (modulo encoding auto-detection). Sorry for being unclear.

Option 2a sounds reasonable, if we decide that the current behavior is broken (which I don&apos;t think we have established already).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>109214</commentid>
    <comment_count>13</comment_count>
    <who name="Jungshik Shin">jshin</who>
    <bug_when>2009-02-10 16:33:15 -0800</bug_when>
    <thetext>(In reply to comment #12)
&gt; &gt; Firefox does NOT have this issue.
&gt; 
&gt; I meant, it doesn&apos;t work well with this site, in the same way that WebKit would
&gt; if we took the patch (modulo encoding auto-detection). Sorry for being unclear.

Thank you for the clarification. 

&gt; Option 2a sounds reasonable, if we decide that the current behavior is broken
&gt; (which I don&apos;t think we have established already).

As for whether the current behavior is better than that of what&apos;s proposed (or that of Firefox), consider the following scenario:

  1. A user on Mac overrides the encoding to MacCyrillic at www.mdf.ru because the site does not specify the encoding (http, meta) and his default encoding (to use in such a case) is Windows-1251. 
  2. He browses for a while at the site and everything seems fine.
  3. He goes to another site which correctly specifies the encoding (either meta or http) that is not MacCyrillic. (say, news.google.ru in UTF-8)
  4. Despite 3, still MacCyrillic will be used totally garbling the page. 
  5. He has to override once more to UTF-8.
  6. He moves to yet another site that correctly specifies the encoding (this time, ISO-8859-5. I&apos;m on purpose not taking an example of Windows-1251 - the default encoding of the user in this case to make the case clearer). 
  7. It&apos;s garbled (because now UTF-8 is in force) and he has to &apos;overrides&apos; the encoding once more to ISO-8859-5
 

Steps 3/4/5 and 6/7 have to be repeated everytime a user moves to another site with an encoding different from the current overriden encoding. With this huge inconvenience and the unnecessary &apos;punishment&apos; of standard-compliant web sites, what we get is that a user does not have to change the encoding at some sites  that certainly need  fixing. (they need to specify the encoding explicitly). 

As I mentioned earlier, setting the default encoding to use in the absence of explicit encoding declaration (and UTF BOM) to the most likely one for a given user (Russian speakers would set it to windows-1251) would relieve a user of having to override the encoding while browsing within a site like like www.mdf.ru. That works well for Safari users on Windows (the site uses Windows-1251 [1]), but does not on Mac (the site uses MacCyrillic without a label and a Russian user would not set it to MacCyrillic even on Mac because there are lot more unlabelled sites in windows-1251 than in MacCyrillic among sites he visits). 

To me, that&apos;s an evangelism issue for those sites (yeah, needless to say, we should accomodate as many web sites as possible, but ...)

Because the gain we get (mentioned in step 1) is rather Mac-specific, I think we can consider yet another alternative if we agree with me (I hope I&apos;m more convincing this time than before :-)) that the current behavior is not desirable. 

  2c. Do 2a but only on Mac (or any combination of PLATFORM-macros)

I&apos;m taking this bug (I keep forgetting this bug :-)). 



[1] Obviously, for multi-lingual users (e.g. Russian and Japanese), that&apos;d not work well. </thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>110624</commentid>
    <comment_count>14</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2009-02-23 13:01:10 -0800</bug_when>
    <thetext>&gt;  2c. Do 2a but only on Mac (or any combination of PLATFORM-macros)

I think that platform-specific behaviors can be considered for problems with known significant user impact. We&apos;re doing this for some editing features, for example. I&apos;d need more evidence to be convinced that encoding overrides fall in this category.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>110869</commentid>
    <comment_count>15</comment_count>
    <who name="Jungshik Shin">jshin</who>
    <bug_when>2009-02-24 17:56:29 -0800</bug_when>
    <thetext>Alexey, thank you for the reply. 

Implementing option 2a reliably turned out to be rather tricky. How about another alternative of making the behavior dependent on a new settings entry (isEncodingOverridePersistent)? Then, the decision can be made outside WebCore by each &apos;embedder&apos;(?). 

I realized that Safari has &apos;Default&apos; in Encoding menu. I had been wondering what it&apos;s for and recently found that it&apos;s for resetting &apos;user override encoding&apos;. As long as Safari has that UI, perhaps, it&apos;s better to keep the option on (unless it&apos;s ok to make that option redundant). 

In the meantime, we may want to give another shot at evangelism for Russian web sites that are consistently mislabelled/unlabelled and use MacCyrillic (throughout sites) (comment #7). Before I heard about them from you, I haven&apos;t come across sites that are so consistent in their mislabelling/unlabelling. Could you list some popular web sites with that problem? 
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>110912</commentid>
    <comment_count>16</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2009-02-24 23:02:34 -0800</bug_when>
    <thetext>Unfortunately, I don&apos;t have any list of such sites.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>110913</commentid>
    <comment_count>17</comment_count>
    <who name="Darin Fisher (:fishd, Google)">fishd</who>
    <bug_when>2009-02-24 23:10:55 -0800</bug_when>
    <thetext>Hey Alexey, what are your thoughts about the runtime setting Jungshik proposes?  

Some background:  Chrome currently has modifications to WebKit to make the encoding override not be persistent.  We&apos;d like to eliminate those forks to WebKit in favor of some kind of solution here.  I&apos;d prefer not to take a functionality change to accomplish the unforking, so could a runtime setting be an acceptable option?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>110915</commentid>
    <comment_count>18</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2009-02-24 23:17:08 -0800</bug_when>
    <thetext>If there were any evidence that the current behavior causes problems for users, I&apos;d be very willing to consider changing it unconditionally.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>110992</commentid>
    <comment_count>19</comment_count>
    <who name="Jungshik Shin">jshin</who>
    <bug_when>2009-02-25 11:39:32 -0800</bug_when>
    <thetext>(In reply to comment #18)
&gt; If there were any evidence that the current behavior causes problems for users,
&gt; I&apos;d be very willing to consider changing it unconditionally.

What do you think of the scenario outlined in comment #13? In Safari, a user has to select &apos;Default&apos; when he moves out of a site that requires overriding encoding and navigates to a site that correctly identifies the encoding. Having to choose &apos;Default&apos; is better than having to know the encoding for the new site and to pick that up. However, in my opinion, it&apos;s still  &quot;punishing&quot; sites that do the &apos;right&apos; thing (in order to make sites that need some &apos;evangelism&apos; work better).

</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>112111</commentid>
    <comment_count>20</comment_count>
    <who name="Ian Fette">ifette</who>
    <bug_when>2009-03-03 17:21:26 -0800</bug_when>
    <thetext>Hi Alexey,

I&apos;m trying to understand the comments thus far. From what I understand, the argument is that making encoding override persistent helps, when you&apos;re on a site that is doing &quot;the wrong thing&quot; (specifying an incorrect charset, or not specifying any at all and ending up with an incorrect auto-detection). I don&apos;t think any of us are disagreeing that it&apos;s a good problem to fix to make sites like mdf.ru work - clearly if I&apos;m browsing around mdf.ru I don&apos;t want to have to select the charset on every single page.

However, when I leave a site that&apos;s doing &quot;the wrong thing&quot;, I think that we (in Chrome at least) would like to be able to clear the persistence at that point. For instance, if I navigate from mdf.ru to nytimes.com, it&apos;s not clear why I would want to render nytimes.com using MacCyrillic (or whatever I had to set the override to be to make mdf.ru). As a user, when I override the charset, I&apos;m saying &quot;I can&apos;t read this page. I want to be able to read this page - here&apos;s some additional information to help make the page reasonable.&quot; As a browser, I interpret that as &quot;Hey, I now have good information I can use to make this page reasonable. I&apos;m going to use it.&quot; When the user views the next page on the same website (domain), I still have reasonably good information (another page on mdf.ru uses MacCyrillic, this page probably does too), so I would still want to use it. When the user views a page on a totally different website (nytimes.com), I don&apos;t really have any good information from the user about how to make nytimes.com display properly, while I do have information from nytimes.com (it specifies a charset). At that point, we would like to be able to use the good information I have. That&apos;s a product call we&apos;ve made from the Chrome side, if other embedders of WebKit want to do something different that&apos;s reasonable too, and I&apos;d like to see if there&apos;s some way we can arrive at a solution that allows those decisions to be made. I think we&apos;ve demonstrated a use case that is broken by the current behavior of making encoding override persistent, you&apos;ve demonstrated a use case where making encoding override persistent helps, and an (optional) compromise has been offered that satisfies both use cases but doesn&apos;t force anyone to change if they don&apos;t want to. As has been stated earlier, we&apos;re really trying hard to unfork here, so I would appreciate any comments you could offer that could help us move forward.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>112185</commentid>
    <comment_count>21</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2009-03-04 06:10:20 -0800</bug_when>
    <thetext>I still think that the most promising approach is 2a.

Something to keep in mind is that we are not discussing a new feature - to the contrary, this is a behavior users lived happily with for many years. I&apos;m now seeking advice from some people who may have more information about actual user experience with Safari. If you could find complaints about the current behavior (e.g. in blogs or discussion forums) that would help a lot. If you could find comments saying that Safari behavior is better than Firefox one, that would help a lot, too!

Obviously, the lack of a &quot;Default&quot; item in Chrome menu changes a lot, as explained in comment 15. Do you think that is worth considering the fix to just add this item to Chrome menu?

We should also consider that Firefox has a much more complicated behavior. My understanding is that it remembers the last encoding used for a page, and uses it when re-opening it later, even after a browser restart. And it uses the encoding override for the current document when navigating to a document with unspecified encoding in the same frame. I don&apos;t think that we should aim to match that exactly.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>112560</commentid>
    <comment_count>22</comment_count>
    <who name="Jungshik Shin">jshin</who>
    <bug_when>2009-03-06 02:12:54 -0800</bug_when>
    <thetext>Coming from Firefox, I had wondered what &apos;Default&apos; is for in Safari as I wrote earlier. I now know what that is. However, there&apos;s another difference between Safari&apos;s encoding menu on the one hand and Chrome/Firefox/IE&apos;s on the other hand. Safari does not indicate what the current encoding is unless it&apos;s overriden manually by a user (that is, if it gets the encoding from http header or meta charset, or BOM detection, the encoding menu points to &apos;Default&apos;). In other browsers, no matter how encoding is determined, the current encoding is indicated in the menu. 

As for adding &apos;Default&apos; (&apos;clear the override&apos;) to Chrome, I thought about that before, but I&apos;m afraid it&apos;s &apos;confusing&apos; to most Chrome users (most of them being IE/Firefox users at least for now). 

Can we agree to disagree for now and introduce a settings to control the behavior? Thanks.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>112563</commentid>
    <comment_count>23</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2009-03-06 02:57:49 -0800</bug_when>
    <thetext>According to a discussion I had, here is what we think would be the best behavior:

1. Encoding override should persist when navigating to a new page from the same domain.
2. The override should be used as a default when navigating to a page in a different domain (so, it will be used if the latter doesn&apos;t specify an encoding).
3. These rules should also be followed when opening a page in a different frame (a different tab, a pop-up etc).

What do you think? I surely hope that we can decide on a common behavior.

Long term, the best direction should obviously be to try and make manual overrides less necessary. The ideal would be to remove the whole encoding menu.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>112853</commentid>
    <comment_count>24</comment_count>
    <who name="Jungshik Shin">jshin</who>
    <bug_when>2009-03-09 10:37:31 -0700</bug_when>
    <thetext>Thank you for your reply. 

The easiest one first: As for removing the encoding menu, I think it&apos;ll be a really lo....ng term goal :-). I agree that it&apos;ll be nice/ideal to live with out the encoding menu, but I doubt it&apos;ll become possible even 5 years from now :-) (I really hope this will turn out wrong !)

As for your three proposed behaviors, I think #1 is reasonable as a middle point between what the current Webkit does and what patches uploaded here does. In addition, it can help users in some cases if we implement that right. 

I&apos;m afraid #2 and #3 (#3 may be different from #2) are not such a good idea. When a user moves out of a domain that needs overriding (e.g. mdrf.ru which needs  overriding to MacCyrillic on Mac) and navigates to another domain that does NOT specify the encoding, IMHO, it&apos;s better for a browser to use the default encoding configured by the user. Let me take an example. 

1. I&apos;m assuming that most of Russian web sites that do NOT explicitly specify the encoding serve windows-1251-encoded pages to all the users (whether a user comes from Mac or not). 
2. As a result, most Russian users would set the default encoding of their browsers to windows-1251
3. A user visits one of a small number of Russian web sites that serve MacCyrillic (e.g. mdrf.ru ) pages to Mac browsers and overrides the encoding to MacCyrillic
4. After navigating for a while, he moves to another web site, &apos;bar.ru&apos; (whose encoding is NOT specified but is actually windows-1251).
5. If we do your #2, &apos;bar.ru&apos; would be garbled although it could&apos;ve been rendered correctly if we just used the default encoding of the user (in this case, windows-1251). 

Is my assumption in step 1 above valid? Then, I don&apos;t have to take another example, I guess. 

Perhaps, a bit more compelling(??) case would be a French speaker (who has a rather good command of Russian and visits Russian web sites from time to time). His default encoding is likely to be windows-1252 (or iso-8859-1. they&apos;re treated the same in most web browsers including webkit-based ones as you know well). If we replace &apos;windows-1251&apos; and &apos;Russian&apos; with &apos;windows-1252/iso-8859-1&apos; and &apos;French&apos; in step 1 and &apos;bar.run&apos; with &apos;bar.fr&apos; in step 4 and 5, I guess it becomes rather clear what can be an issue with your proposal #2. 


Let&apos;s go back to the patch uploaded here (that is bit-rotten) combined with a preference to control the behavior vs your #1 (and my #2a). You&apos;re certainly in favor or doing your #1 (my #2a) and I think your #1 is reasonable.  Would you consider a patch doing the former (current patch updated + a preference) if I promise that I will follow that up with implementing your #1 soon (not likely to be within a few weeks, though)? Thank you in advance for your consideration :-)


 
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>112862</commentid>
    <comment_count>25</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2009-03-09 11:00:10 -0700</bug_when>
    <thetext>I actually think that #2 makes sense. Perhaps it can be amended as &quot;The override should be used as a default when navigating to a page in a different domain _via clicking a link_&quot;. So, a French user reading Russian Web sites will stay with windows-1251 encoding. In my experience, reading foreign language sites is by far the most common reason to override the encoding, and the vast majority of sites in each language either use the same encoding, or have explicitly specified encoding.

Are you proposing to add the preference as a short-term solution, with a plan to standardize on a common behavior soon, and to remove the preference? In my opinion, that&apos;s fine. Adding the preference permanently is not totally unacceptable, but I don&apos;t think that it would be good engineering.

I just had a thought that modifying WebCore might not be even necessary to reset encoding override on each navigation - aren&apos;t there enough callbacks made to detect navigations and reset frame encoding from the client? I didn&apos;t investigate this idea to make sure that it&apos;s implementable.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>113034</commentid>
    <comment_count>26</comment_count>
    <who name="Jungshik Shin">jshin</who>
    <bug_when>2009-03-10 12:01:49 -0700</bug_when>
    <thetext>Thank you for your reply. In the previous comment, I meant &apos;preference&apos; as a short-term measure until we implement a common behavior. Because you said you&apos;re ok with that as a temporary measure, I&apos;ll make a patch with that. 

As for achieving what&apos;s requested in this bug without changing WebCore, I looked into that possibility a few weeks ago when I figured out what &apos;Default&apos; in Safari&apos;s encoding menu is for (resetting the overridden encoding). My thought was that perhaps we can automatically do what &apos;selecting Default&apos; triggers. Shortly after that, I gave up that idea, but I don&apos;t remember why. I&apos;ll take a brief look at doing on the client-side before making a patch for the &apos;temporary&apos; measure. 
</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>19792</attachid>
            <date>2008-03-16 04:27:04 -0700</date>
            <delta_ts>2010-06-10 16:43:05 -0700</delta_ts>
            <desc>patch v1 for fixing this problem</desc>
            <filename>patch.txt</filename>
            <type>text/plain</type>
            <size>2711</size>
            <attacher name="johnnyding">johnnyding.webkit</attacher>
            
              <data encoding="base64">SW5kZXg6IFdlYkNvcmUvQ2hhbmdlTG9nCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIFdlYkNvcmUvQ2hhbmdlTG9n
CShyZXZpc2lvbiAzMTA3OSkKKysrIFdlYkNvcmUvQ2hhbmdlTG9nCSh3b3JraW5nIGNvcHkpCkBA
IC0xLDMgKzEsMjAgQEAKKzIwMDgtMDMtMTYgIEpvaG5ueSBEaW5nICA8am9obm55ZGluZy53ZWJr
aXRAZ21haWwuY29tPgorCisgICAgICAgIFJldmlld2VkIGJ5IE5PQk9EWSAoT09QUyEpLgorCisg
ICAgICAgIEJ1ZyAxNzg3MzogRW5jb2Rpbmcgb3ZlcnJpZGUgc2hvdWxkIG5vdCBiZSBwZXJzaXN0
ZW50LgorICAgICAgICBodHRwOi8vYnVncy53ZWJraXQub3JnL3Nob3dfYnVnLmNnaT9pZD0xNzg3
MworCisgICAgICAgIENoZWNrIHd0aGV0aGVyIGN1cnJlbnQgcGFnZSdzIGxvYWQgdHlw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29uc3QKK3sKKyAgICBpZiAoZnJhbWVMb2FkZXIoKS0+bG9hZFR5cGUoKSA9PSBG
cmFtZUxvYWRUeXBlUmVsb2FkQWxsb3dpbmdTdGFsZURhdGEpCisgICAgICAgIHJldHVybiBtX292
ZXJyaWRlRW5jb2Rpbmc7CisgICAgZWxzZQorICAgICAgICByZXR1cm4gZW1wdHlBdG9tOworfQor
CiB9CkluZGV4OiBXZWJDb3JlL2xvYWRlci9Eb2N1bWVudExvYWRlci5oCj09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0t
IFdlYkNvcmUvbG9hZGVyL0RvY3VtZW50TG9hZGVyLmgJKHJldmlzaW9uIDMxMDc5KQorKysgV2Vi
Q29yZS9sb2FkZXIvRG9jdW1lbnRMb2FkZXIuaAkod29ya2luZyBjb3B5KQpAQCAtMTEwLDcgKzEx
MCw3IEBAIG5hbWVzcGFjZSBXZWJDb3JlIHsKICAgICAgICAgYm9vbCBpc0xvYWRpbmdJbkFQSVNl
bnNlKCkgY29uc3Q7CiAgICAgICAgIHZvaWQgc2V0UHJpbWFyeUxvYWRDb21wbGV0ZShib29sKTsK
ICAgICAgICAgdm9pZCBzZXRUaXRsZShjb25zdCBTdHJpbmcmKTsKLSAgICAgICAgY29uc3QgU3Ry
aW5nJiBvdmVycmlkZUVuY29kaW5nKCkgY29uc3QgeyByZXR1cm4gbV9vdmVycmlkZUVuY29kaW5n
OyB9CisgICAgICAgIGNvbnN0IFN0cmluZyYgb3ZlcnJpZGVFbmNvZGluZygpIGNvbnN0OwogCiAj
aWYgUExBVEZPUk0oTUFDKQogICAgICAgICB2b2lkIHNjaGVkdWxlKFNjaGVkdWxlUGFpciopOwpJ
bmRleDogV2ViQ29yZS9sb2FkZXIvRnJhbWVMb2FkZXIuY3BwCj09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIFdlYkNv
cmUvbG9hZGVyL0ZyYW1lTG9hZGVyLmNwcAkocmV2aXNpb24gMzEwNzkpCisrKyBXZWJDb3JlL2xv
YWRlci9GcmFtZUxvYWRlci5jcHAJKHdvcmtpbmcgY29weSkKQEAgLTIwNTMsNyArMjA1Myw4IEBA
IHZvaWQgRnJhbWVMb2FkZXI6OmxvYWQoY29uc3QgS1VSTCYgbmV3VVIKICAgICAgICAgICAgIC8v
IEV4YW1wbGUgb2YgdGhpcyBjYXNlIGFyZSBzaXRlcyB0aGF0IHJlbG9hZCB0aGUgc2FtZSBVUkwg
d2l0aCBhIGRpZmZlcmVudCBjb29raWUKICAgICAgICAgICAgIC8vIGRyaXZpbmcgdGhlIGdlbmVy
YXRlZCBjb250ZW50LCBvciBhIG1hc3RlciBmcmFtZSB3aXRoIGxpbmtzIHRoYXQgZHJpdmUgYSB0
YXJnZXQKICAgICAgICAgICAgIC8vIGZyYW1lLCB3aGVyZSB0aGUgdXNlciBoYXMgY2xpY2tlZCBv
biB0aGUgc2FtZSBsaW5rIHJlcGVhdGVkbHkuCi0gICAgICAgICAgICBtX2xvYWRUeXBlID0gRnJh
bWVMb2FkVHlwZVNhbWU7CisgICAgICAgICAgICBpZiAobV9sb2FkVHlwZSAhPSBGcmFtZUxvYWRU
eXBlUmVsb2FkQWxsb3dpbmdTdGFsZURhdGEpCisgICAgICAgICAgICAgICAgbV9sb2FkVHlwZSA9
IEZyYW1lTG9hZFR5cGVTYW1lOwogICAgIH0KIH0KIAo=
</data>

          </attachment>
          <attachment
              isobsolete="1"
              ispatch="1"
              isprivate="0"
          >
            <attachid>19793</attachid>
            <date>2008-03-16 05:06:28 -0700</date>
            <delta_ts>2008-03-16 20:19:32 -0700</delta_ts>
            <desc>patch v2 for fixing this problem by using different way</desc>
            <filename>patch.txt</filename>
            <type>text/plain</type>
            <size>3359</size>
            <attacher name="johnnyding">johnnyding.webkit</attacher>
            
              <data encoding="base64">SW5kZXg6IFdlYkNvcmUvQ2hh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RW5jb2RpbmcoKSk7CisgICAgbG9hZGVyLT5zZXRPdmVycmlkZUVuY29kaW5nKCIiKTsKICAgICAK
ICAgICBsb2FkKGxvYWRlci5nZXQoKSwgRnJhbWVMb2FkVHlwZVJlbG9hZCwgMCk7CiB9Cgo=
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>19821</attachid>
            <date>2008-03-16 20:19:32 -0700</date>
            <delta_ts>2008-04-28 04:46:38 -0700</delta_ts>
            <desc>patch v2 for fixing this problem by using different way</desc>
            <filename>patch.txt</filename>
            <type>text/plain</type>
            <size>3336</size>
            <attacher name="johnnyding">johnnyding.webkit</attacher>
            
              <data encoding="base64">SW5kZXg6IFdlYkNvcmUvQ2hhbmdlTG9nCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIFdlYkNvcmUvQ2hhbmdlTG9n
CShyZXZpc2lvbiAzMTA3OSkKKysrIFdlYkNvcmUvQ2hhbmdlTG9nCSh3b3JraW5nIGNvcHkpCkBA
IC0xLDMgKzEsMTkgQEAKKzIwMDgtMDMtMTYgIEpvaG5ueSBEaW5nICA8am9obm55ZGluZy53ZWJr
aXRAZ21haWwuY29tPgorCisgICAgICAgIFJldmlld2VkIGJ5IE5PQk9EWSAoT09QUyEpLgorCisg
ICAgICAgIEJ1ZyAxNzg3MzogRW5jb2Rpbmcgb3ZlcnJpZGUgc2hvdWxkIG5vdCBiZSBwZXJzaXN0
ZW50LgorICAgICAgICBodHRwOi8vYnVncy53ZWJraXQub3JnL3Nob3dfYnVnLmNnaT9pZD0xNzg3
MworCisgICAgICAgIElmIGZyYW1lIGxvYWQgdHlwZSBpcyBGcmFtZUxvYWRUeXBlUmVsb2FkQWxs
b3dpbmdTdGFsZURhdGEKKyAgICAgICAgdGhlbiB1c2UgdmFsdWUgZW5jb2Rpbmcgb3ZlcnJpZGUs
IG90aGVyd2lzZSB1c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yKGxvYWRl
cik7CkBAIC0yMzI3LDcgKzIzMzUsNyBAQCB2b2lkIEZyYW1lTG9hZGVyOjpyZWxvYWQoKQogICAg
IGlmIChyZXF1ZXN0Lmh0dHBNZXRob2QoKSA9PSAiUE9TVCIpCiAgICAgICAgIGxvYWRlci0+c2V0
VHJpZ2dlcmluZ0FjdGlvbihOYXZpZ2F0aW9uQWN0aW9uKHJlcXVlc3QudXJsKCksIE5hdmlnYXRp
b25UeXBlRm9ybVJlc3VibWl0dGVkKSk7CiAKLSAgICBsb2FkZXItPnNldE92ZXJyaWRlRW5jb2Rp
bmcobV9kb2N1bWVudExvYWRlci0+b3ZlcnJpZGVFbmNvZGluZygpKTsKKyAgICBsb2FkZXItPnNl
dE92ZXJyaWRlRW5jb2RpbmcoU3RyaW5nKCkpOwogICAgIAogICAgIGxvYWQobG9hZGVyLmdldCgp
LCBGcmFtZUxvYWRUeXBlUmVsb2FkLCAwKTsKIH0K
</data>
<flag name="review"
          id="8671"
          type_id="1"
          status="-"
          setter="ap"
    />
          </attachment>
      

    </bug>

</bugzilla>