<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK: Символы ??? при компиляции в ANSI]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=16364&amp;type=atom" />
	<updated>2021-05-18T18:36:32Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=16364</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Символы ??? при компиляции в ANSI]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=147978#p147978" />
			<content type="html"><![CDATA[<p>В FileAppendBinary можно опцию &quot;a&quot; использовать:<br /></p><div class="codebox"><pre><code>FileAppendBinary(filePath, pData, dataSize, encoding) {
   File := FileOpen(filePath, &quot;a&quot;, encoding)
   File.RawWrite(pData + 0, dataSize)
   File.Close()
}</code></pre></div><p>или<br /></p><div class="codebox"><pre><code>FileAppendBinary(filePath, pData, dataSize, encoding) {
   Return FileOpen(filePath, &quot;a&quot;, encoding).RawWrite(pData + 0, dataSize)
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2021-05-18T18:36:32Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=147978#p147978</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Символы ??? при компиляции в ANSI]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=147976#p147976" />
			<content type="html"><![CDATA[<p><strong>teadrinker</strong><br />Тогда RegExReplace буду уже использовать вызовом второго скрипта.<br />Буду с этим разбираться как и что работает.<br />Спасибо за примеры &lt;3</p>]]></content>
			<author>
				<name><![CDATA[Clannad5]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=39853</uri>
			</author>
			<updated>2021-05-18T18:12:15Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=147976#p147976</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Символы ??? при компиляции в ANSI]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=147973#p147973" />
			<content type="html"><![CDATA[<p>C RegExReplace в ANSI никак наверно, нужно работать с бинарными данными. В Edit так можно:<br /></p><div class="codebox"><pre><code>File := FileOpen(&quot;C:\Users\User\Desktop\test.txt&quot;, &quot;r&quot;, &quot;UTF-16&quot;)
VarSetCapacity(buff, File.Length + 2, 0)
File.RawRead(buff, File.Length)
File.Close()

Gui, Add, Edit, hwndhEdit w200
DllCall(&quot;SendMessageW&quot;, &quot;Ptr&quot;, hEdit, &quot;UInt&quot;, EM_REPLACESEL := 0xC2, &quot;Ptr&quot;, 0, &quot;Ptr&quot;, &amp;buff)
Gui, Show</code></pre></div>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2021-05-18T18:05:37Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=147973#p147973</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Символы ??? при компиляции в ANSI]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=147971#p147971" />
			<content type="html"><![CDATA[<p><strong>teadrinker</strong></p><p>Так действительно получилось.<br />А как этот метод применить к регулярным выражениям?<br />К примеру я хочу, чтобы вначале строки появился один из этих символов.<br />В простом варианте я бы написал:</p><div class="codebox"><pre><code>Text := RegExReplace(Text, &quot;^&quot;, &quot;ࢄ&quot;)</code></pre></div><p>А с вашим способом это как-то можно провернуть?<br />И еще, как добавить эти символы в Edit элемент из GUI?<br />К примеру загрузив эти символы из .txt файла.</p>]]></content>
			<author>
				<name><![CDATA[Clannad5]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=39853</uri>
			</author>
			<updated>2021-05-18T17:48:03Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=147971#p147971</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Символы ??? при компиляции в ANSI]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=147970#p147970" />
			<content type="html"><![CDATA[<p>Файл, если уже существует, должен быть в кодировке UTF-16.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2021-05-18T17:47:58Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=147970#p147970</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Символы ??? при компиляции в ANSI]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=147969#p147969" />
			<content type="html"><![CDATA[<p>Вот так попробуйте:<br /></p><div class="codebox"><pre><code>SpaceArray := [2181, 2181, 2181, 2181]
VarSetCapacity(str, len := SpaceArray.Count()*2, 0)
for k, v in SpaceArray
   NumPut(v, str, (A_Index - 1)*2, &quot;UShort&quot;)

FileAppendBinary(A_Desktop . &quot;\test.txt&quot;, &amp;str, len, &quot;UTF-16&quot;)

FileAppendBinary(filePath, pData, dataSize, encoding) {
   File := FileOpen(filePath, &quot;rw&quot;, encoding)
   File.Pos := File.Length
   File.RawWrite(pData + 0, dataSize)
   File.Close()
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2021-05-18T17:42:05Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=147969#p147969</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Символы ??? при компиляции в ANSI]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=147968#p147968" />
			<content type="html"><![CDATA[<p><strong>teadrinker</strong><br />Убранный процент ничего не решил c:</p><p>Нашел такой метод:<br /></p><div class="codebox"><pre><code>
file := FileOpen(&quot;t.txt&quot;, &quot;a&quot;)
file.WriteChar(2181)
file.Close()
</code></pre></div><p>Но он почему-то оставляет символ в виде трёх точек.</p>]]></content>
			<author>
				<name><![CDATA[Clannad5]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=39853</uri>
			</author>
			<updated>2021-05-18T17:40:53Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=147968#p147968</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Символы ??? при компиляции в ANSI]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=147967#p147967" />
			<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-05-18T17:36:50Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=147967#p147967</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Символы ??? при компиляции в ANSI]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=147966#p147966" />
			<content type="html"><![CDATA[<p><strong>teadrinker</strong><br />В файл так же записывается пустая строка.<br />Записываю так:<br /></p><div class="codebox"><pre><code>File := % Chr(2181)
FileAppEnd,
(
%File%
), t.txt</code></pre></div><p>Может я как-то неправильно записываю?</p>]]></content>
			<author>
				<name><![CDATA[Clannad5]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=39853</uri>
			</author>
			<updated>2021-05-18T17:34:18Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=147966#p147966</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Символы ??? при компиляции в ANSI]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=147965#p147965" />
			<content type="html"><![CDATA[<p>Так вы же сказали, вам нужно в файл записывать, зачем вам MsgBox?</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2021-05-18T17:29:00Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=147965#p147965</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Символы ??? при компиляции в ANSI]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=147964#p147964" />
			<content type="html"><![CDATA[<p><strong>teadrinker</strong></p><p>При компиляции данного способа в ANSI, в Msgbox - пустая строка.</p><p>Если не компилировать, то символ видно.<br />Если вариант запуска .ahk ставить на сборку ANSI - символа не видно.</p>]]></content>
			<author>
				<name><![CDATA[Clannad5]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=39853</uri>
			</author>
			<updated>2021-05-18T17:26:50Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=147964#p147964</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Символы ??? при компиляции в ANSI]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=147963#p147963" />
			<content type="html"><![CDATA[<p>Можно использовать код символов вместо самих символов:<br /></p><div class="codebox"><pre><code>MsgBox, % Chr(2181)</code></pre></div>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2021-05-18T17:01:43Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=147963#p147963</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Символы ??? при компиляции в ANSI]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=147962#p147962" />
			<content type="html"><![CDATA[<p><strong>teadrinker</strong></p><p>Да, эти символы без графических знаков.<br />Они такими и должны быть.<br />AHK с Unicode их будет понимать как что-то типа [] - квадратного символа.<br />AHK с ANSI их переводит в знак вопроса.</p><p>Мне нужно решить эту проблему, т.к AHK Protector существует только на сборке ANSI, а у меня есть символы, с которыми ANSI не может работать, в данном случае.</p><p>Мне нужно чтобы эти символы можно было загружать в переменную, в массив, а так же обратно в .txt файл через Fileappend.<br />Пока думал только над тем, чтобы создать второй скрипт, который бы как-то принимал и обрабатывал эти данные отдельно, но хотелось бы этого избежать.</p>]]></content>
			<author>
				<name><![CDATA[Clannad5]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=39853</uri>
			</author>
			<updated>2021-05-18T16:57:00Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=147962#p147962</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Символы ??? при компиляции в ANSI]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=147961#p147961" />
			<content type="html"><![CDATA[<p>Я даже не уверен, что правильно вижу в браузере символы, которые нужны. У меня отображается так:<br /> <br /> <span class="postimg"><img src="https://i.imgur.com/FhgMB0T.png" alt="https://i.imgur.com/FhgMB0T.png" /></span><br /> <br />Так и должно быть?</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2021-05-18T16:50:01Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=147961#p147961</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Символы ??? при компиляции в ANSI]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=147956#p147956" />
			<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-05-18T16:39:43Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=147956#p147956</id>
		</entry>
</feed>
