<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Серый форум &mdash; AHK: Скачивание в определенной кодировке]]></title>
		<link>https://forum.script-coding.com/viewtopic.php?id=15186</link>
		<atom:link href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=15186&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «AHK: Скачивание в определенной кодировке».]]></description>
		<lastBuildDate>Mon, 11 Jan 2021 19:34:44 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: AHK: Скачивание в определенной кодировке]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=144690#p144690</link>
			<description><![CDATA[<p>Вот я и говорю кино и немцы.<br />Помимо &quot;если и значит&quot;, надо ввести новый оператор &quot;наверно&quot;, тогда все вопросы информатики закончатся. )</p>]]></description>
			<author><![CDATA[null@example.com (serzh82saratov)]]></author>
			<pubDate>Mon, 11 Jan 2021 19:34:44 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=144690#p144690</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Скачивание в определенной кодировке]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=144683#p144683</link>
			<description><![CDATA[<p>Если сайт был создан, когда HTML 5 уже появился, значит они должны были рассчитывать на отображение в cp1252, если раньше — то наверно на cp28591.</p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Mon, 11 Jan 2021 18:06:22 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=144683#p144683</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Скачивание в определенной кодировке]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=144681#p144681</link>
			<description><![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>]]></description>
			<author><![CDATA[null@example.com (serzh82saratov)]]></author>
			<pubDate>Mon, 11 Jan 2021 17:23:30 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=144681#p144681</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Скачивание в определенной кодировке]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=144680#p144680</link>
			<description><![CDATA[<p>CP1252 работает наоборот — те англ. кавычки сохраняет, а диакритику нет.</p>]]></description>
			<author><![CDATA[null@example.com (DD)]]></author>
			<pubDate>Mon, 11 Jan 2021 13:06:47 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=144680#p144680</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Скачивание в определенной кодировке]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=144679#p144679</link>
			<description><![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>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Mon, 11 Jan 2021 11:10:54 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=144679#p144679</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Скачивание в определенной кодировке]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=144676#p144676</link>
			<description><![CDATA[<p>Как то опечатался, наверняка я думал про Западно-Европейскую, а не про кириллицу.</p>]]></description>
			<author><![CDATA[null@example.com (serzh82saratov)]]></author>
			<pubDate>Mon, 11 Jan 2021 10:35:21 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=144676#p144676</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Скачивание в определенной кодировке]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=144674#p144674</link>
			<description><![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>]]></description>
			<author><![CDATA[null@example.com (Malcev)]]></author>
			<pubDate>Mon, 11 Jan 2021 10:11:25 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=144674#p144674</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Скачивание в определенной кодировке]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=144672#p144672</link>
			<description><![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>]]></description>
			<author><![CDATA[null@example.com (DD)]]></author>
			<pubDate>Mon, 11 Jan 2021 09:00:16 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=144672#p144672</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Скачивание в определенной кодировке]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=144671#p144671</link>
			<description><![CDATA[<p>Там разве в StrGet не cp1251 должно быть.</p>]]></description>
			<author><![CDATA[null@example.com (serzh82saratov)]]></author>
			<pubDate>Mon, 11 Jan 2021 08:06:08 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=144671#p144671</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Скачивание в определенной кодировке]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=144669#p144669</link>
			<description><![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>]]></description>
			<author><![CDATA[null@example.com (DD)]]></author>
			<pubDate>Mon, 11 Jan 2021 02:20:53 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=144669#p144669</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Скачивание в определенной кодировке]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=144668#p144668</link>
			<description><![CDATA[<p>Не, обманул, после<br /></p><div class="codebox"><pre><code>RTxt := StrGet(pdata, length, &quot;cp28591&quot;)</code></pre></div><p>у вас уже есть текст в переменной. Осталось его только в UTF-8 в файл записать.</p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Sun, 10 Jan 2021 23:54:09 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=144668#p144668</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Скачивание в определенной кодировке]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=144667#p144667</link>
			<description><![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>]]></description>
			<author><![CDATA[null@example.com (DD)]]></author>
			<pubDate>Sun, 10 Jan 2021 23:46:35 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=144667#p144667</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Скачивание в определенной кодировке]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=144666#p144666</link>
			<description><![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>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Sun, 10 Jan 2021 23:23:27 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=144666#p144666</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Скачивание в определенной кодировке]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=144664#p144664</link>
			<description><![CDATA[<p>Оказывается, я пробовал правильно, указывая &quot;CP28591&quot;, но при попытке сохранить такой текст в файл, кодировка слетала. Как сохранить в исходной кодировке? А лучше прежде преобразовать в utf-8?</p>]]></description>
			<author><![CDATA[null@example.com (DD)]]></author>
			<pubDate>Sun, 10 Jan 2021 23:04:38 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=144664#p144664</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Скачивание в определенной кодировке]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=144659#p144659</link>
			<description><![CDATA[<p>Кодировку правильную подобрать, наверно.</p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Sun, 10 Jan 2021 22:35:49 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=144659#p144659</guid>
		</item>
	</channel>
</rss>
