<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK: Скачивание в определенной кодировке]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=15186&amp;type=atom" />
	<updated>2021-01-11T19:34:44Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=15186</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Скачивание в определенной кодировке]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=144690#p144690" />
			<content type="html"><![CDATA[<p>Вот я и говорю кино и немцы.<br />Помимо &quot;если и значит&quot;, надо ввести новый оператор &quot;наверно&quot;, тогда все вопросы информатики закончатся. )</p>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2021-01-11T19:34:44Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=144690#p144690</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Скачивание в определенной кодировке]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=144683#p144683" />
			<content type="html"><![CDATA[<p>Если сайт был создан, когда HTML 5 уже появился, значит они должны были рассчитывать на отображение в cp1252, если раньше — то наверно на cp28591.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2021-01-11T18:06:22Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=144683#p144683</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Скачивание в определенной кодировке]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=144681#p144681" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>
url := &quot;https://www.bl.uk/catalogues/illuminatedmanuscripts/record.asp?MSID=240&quot;
HTTP := ComObjCreate(&quot;Msxml2.XMLHTTP.6.0&quot;)
HTTP.Open(&quot;GET&quot;, url, 0)
HTTP.Send()
body := HTTP.ResponseBody
pdata := NumGet(ComObjValue(body) + 8 + A_PtrSize)
length := body.MaxIndex() - body.MinIndex() + 1
RTxt := StrGet(pdata, length, &quot;cp1252&quot;)
FileDelete %A_Desktop%\_tmp.html
FileAppend, %RTxt%`n, %A_Desktop%\_tmp.html, cp1252
run %A_Desktop%\_tmp.html
</code></pre></div><p>По какой ссылке кавычек нет?<br /></p><div class="quotebox"><cite>teadrinker пишет:</cite><blockquote><p>В проекте стандарта HTML 5 предписывается показывать ISO-8859-1 как Windows-1252</p></blockquote></div><p>А ты какой вывод сделал, я вот ничего не понял из множества тем по этому вопросу.</p>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2021-01-11T17:23:30Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=144681#p144681</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Скачивание в определенной кодировке]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=144680#p144680" />
			<content type="html"><![CDATA[<p>CP1252 работает наоборот — те англ. кавычки сохраняет, а диакритику нет.</p>]]></content>
			<author>
				<name><![CDATA[DD]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=25263</uri>
			</author>
			<updated>2021-01-11T13:06:47Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=144680#p144680</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Скачивание в определенной кодировке]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=144679#p144679" />
			<content type="html"><![CDATA[<p>Кодировка указана в заголовке HTML: charset=iso-8859-1.<br /></p><div class="quotebox"><cite>Википедия пишет:</cite><blockquote><p>В проекте стандарта HTML 5 предписывается показывать ISO-8859-1 как Windows-1252</p></blockquote></div><div class="quotebox"><cite>MSDN пишет:</cite><blockquote><p>28591	iso-8859-1	ISO 8859-1 Latin 1; Western European (ISO)</p></blockquote></div>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2021-01-11T11:10:54Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=144679#p144679</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Скачивание в определенной кодировке]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=144676#p144676" />
			<content type="html"><![CDATA[<p>Как то опечатался, наверняка я думал про Западно-Европейскую, а не про кириллицу.</p>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2021-01-11T10:35:21Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=144676#p144676</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Скачивание в определенной кодировке]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=144674#p144674" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>DD пишет:</cite><blockquote><p>StrPut(vText, &amp;vTemp, &quot;CP28591&quot;)</p></blockquote></div><div class="quotebox"><cite>serzh82saratov пишет:</cite><blockquote><p>Там разве в StrGet не cp1251 должно быть.</p></blockquote></div><p>А как вы это определили?<br />Хром кодирует в &quot;windows-1252&quot;.<br />document.characterSet в консоли.</p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2021-01-11T10:11:25Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=144674#p144674</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Скачивание в определенной кодировке]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=144672#p144672" />
			<content type="html"><![CDATA[<p>Но тогда <a href="https://www.bl.uk/catalogues/illuminatedmanuscripts/record.asp?MSID=240">по этой ссылке</a> слетит кодировка с «<strong>£</strong>» и «<strong>é</strong>». Вроде, проблема возникает со знаками «<strong>’</strong>» и «<strong>‘</strong>». Как правильно их менять на каком-то этапе?<br /></p><div class="codebox"><pre><code>
      StringReplace, body, body, ’, &#039;, All
      StringReplace, body, body, ‘, &#039;, All</code></pre></div>]]></content>
			<author>
				<name><![CDATA[DD]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=25263</uri>
			</author>
			<updated>2021-01-11T09:00:16Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=144672#p144672</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Скачивание в определенной кодировке]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=144671#p144671" />
			<content type="html"><![CDATA[<p>Там разве в StrGet не cp1251 должно быть.</p>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2021-01-11T08:06:08Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=144671#p144671</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Скачивание в определенной кодировке]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=144669#p144669" />
			<content type="html"><![CDATA[<p>По предыдущей ссылке норм кодирует, — но почему по этой перед текстом «The Allegorical Menorah», квадрат возникает? —<br /></p><div class="codebox"><pre><code>url := &quot;https://www.bl.uk/catalogues/illuminatedmanuscripts/record.asp?MSID=3&quot;
HTTP := ComObjCreate(&quot;Msxml2.XMLHTTP.6.0&quot;)
HTTP.Open(&quot;GET&quot;, url, 0)
HTTP.Send()
body := HTTP.ResponseBody
pdata := NumGet(ComObjValue(body) + 8 + A_PtrSize)
length := body.MaxIndex() - body.MinIndex() + 1
RTxt := StrGet(pdata, length, &quot;cp28591&quot;)
FileAppend, %RTxt%`n, %A_Desktop%\_tmp.html, UTF-8</code></pre></div>]]></content>
			<author>
				<name><![CDATA[DD]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=25263</uri>
			</author>
			<updated>2021-01-11T02:20:53Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=144669#p144669</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Скачивание в определенной кодировке]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=144668#p144668" />
			<content type="html"><![CDATA[<p>Не, обманул, после<br /></p><div class="codebox"><pre><code>RTxt := StrGet(pdata, length, &quot;cp28591&quot;)</code></pre></div><p>у вас уже есть текст в переменной. Осталось его только в UTF-8 в файл записать.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2021-01-10T23:54:09Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=144668#p144668</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Скачивание в определенной кодировке]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=144667#p144667" />
			<content type="html"><![CDATA[<p>А как правильно вписать преобразование?<br /></p><div class="codebox"><pre><code>StrPut(vText, &amp;vTemp, &quot;CP28591&quot;)
s := StrGet(&amp;vTemp, &quot;UTF-8&quot;) </code></pre></div>]]></content>
			<author>
				<name><![CDATA[DD]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=25263</uri>
			</author>
			<updated>2021-01-10T23:46:35Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=144667#p144667</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Скачивание в определенной кодировке]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=144666#p144666" />
			<content type="html"><![CDATA[<p>В исходной кодировке можно прямо из буфера:<br /></p><div class="codebox"><pre><code>url := &quot;https://www.bl.uk/catalogues/illuminatedmanuscripts/record.asp?MSID=2611&quot;
HTTP := ComObjCreate(&quot;Msxml2.XMLHTTP.6.0&quot;)
HTTP.Open(&quot;GET&quot;, url, 0)
HTTP.Send()
body := HTTP.ResponseBody
pdata := NumGet(ComObjValue(body) + 8 + A_PtrSize)
length := body.MaxIndex() - body.MinIndex() + 1

filePath := A_Desktop . &quot;\site.html&quot;
File := FileOpen(filePath, &quot;w&quot;, &quot;cp0&quot;)
File.RawWrite(pdata + 0, length)
File.Close()</code></pre></div><p>Ну, или так:<br /></p><div class="codebox"><pre><code>URLDownloadToFile, https://www.bl.uk/catalogues/illuminatedmanuscripts/record.asp?MSID=2611, % A_Desktop . &quot;\site.html&quot;</code></pre></div><p>Преобразовать можно с помощью StrPut, StrGet.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2021-01-10T23:23:27Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=144666#p144666</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Скачивание в определенной кодировке]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=144664#p144664" />
			<content type="html"><![CDATA[<p>Оказывается, я пробовал правильно, указывая &quot;CP28591&quot;, но при попытке сохранить такой текст в файл, кодировка слетала. Как сохранить в исходной кодировке? А лучше прежде преобразовать в utf-8?</p>]]></content>
			<author>
				<name><![CDATA[DD]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=25263</uri>
			</author>
			<updated>2021-01-10T23:04:38Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=144664#p144664</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Скачивание в определенной кодировке]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=144659#p144659" />
			<content type="html"><![CDATA[<p>Кодировку правильную подобрать, наверно.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2021-01-10T22:35:49Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=144659#p144659</id>
		</entry>
</feed>
