From: Dmitry Timoshkov Subject: Re: [PATCH] mshtml: When creating new channel default to current locale charset. Message-Id: <20200623233522.e2d2c62728535d98fd587c0c@baikal.ru> Date: Tue, 23 Jun 2020 23:35:22 +0800 In-Reply-To: References: <20200619111913.b69c04677c2a5ddce60da412@baikal.ru> <20200622180811.d0aa8ca15e038ad19742f90c@baikal.ru> Jacek Caban wrote: > >> I don't know what's the exact problem you're trying to fix, but we maybe > >> we don't set it in some case when we should? Looking at Gecko code, I > >> just noticed that we should try to extract it from content type in > >> SetContentType(), for example. > > I have an application that includes many other .html files from its main.html. > > Main html has the following head: > > > > > > > > > > > > > > > > and Wine's mshtml renders this file correctly. Main html includes another > > file with the following head: > > > > > > > > > > > > > > > > and this one renders using wrong locale. > > > > According to https://www.w3schools.com/charsets/default.asp both syntaxes > > are legal and should be supported starting from HTML 4. > > > > According to my testing when loading HTML gecko first queries charset from > > mshtml, it returns "", and then gecko renders page using wrong locale. With > > my patch gecko gets "windows-1251" and this fixes page rendering. > > > > Is this a bug in gecko or mshtml? > > > The easiest way to check is it to write a trivial HTML file and try it > on IE, Firefox (preferably 47, which is the version Wine Gecko bases on) > and Wine iexplore.exe. It works on IE, I haven't tested with Firefox and Wine's iexplore.exe. > The element in the second HTML looks > suspicious, it doesn't have http-equiv="Content-Type" attribute. Does it > help if you add one? Yes, it does help. > Also, is the problem reproducible if you load the > subframe as a main frame? How can I do that? -- Dmitry.