<?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=13171&amp;type=atom" />
	<updated>2017-11-07T19:31:48Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=13171</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: изменить кодировку переменной]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=120903#p120903" />
			<content type="html"><![CDATA[<p>Решил проблему запуска на ахк unicode.<br />Заменил Str, на AStr.<br />LoadLibrary на LoadLibraryA.<br />Странно, но GetProcAddress не надо трогать иначе не будет работать.<br /></p><div class="codebox"><pre><code>#NoEnv 

PATH_OVERLAY := &quot;E:\testspeech\recor and send\dx9_overlay.dll&quot;

hModule := DllCall(&quot;LoadLibraryA&quot;,AStr, PATH_OVERLAY)
if(hModule == -1 || hModule == 0)
{
	MsgBox, 48, Error, The dll-file couldn&#039;t be loaded!
	ExitApp
}


Init_func 				:= DllCall(&quot;GetProcAddress&quot;, UInt, hModule, AStr, &quot;Init&quot;)
SetParam_func 			:= DllCall(&quot;GetProcAddress&quot;, UInt, hModule, AStr, &quot;SetParam&quot;)

TextCreate_func 		:= DllCall(&quot;GetProcAddress&quot;, UInt, hModule, AStr, &quot;TextCreate&quot;)
DestroyAllVisual_func	:= DllCall(&quot;GetProcAddress&quot;, UInt, hModule, AStr, &quot;DestroyAllVisual&quot;)
TextDestroy_func 		:= DllCall(&quot;GetProcAddress&quot;, UInt, hModule, AStr, &quot;TextDestroy&quot;)
TextSetShown_func 		:= DllCall(&quot;GetProcAddress&quot;, UInt, hModule, AStr, &quot;TextSetShown&quot;)
TextSetString_func 		:= DllCall(&quot;GetProcAddress&quot;, UInt, hModule, AStr, &quot;TextSetString&quot;)


Init()
{
	global Init_func
	res := DllCall(Init_func)
	return res
}

SetParam(str_Name, str_Value)
{
	global SetParam_func
	res := DllCall(SetParam_func, AStr, str_Name, AStr, str_Value)
	return res
}

TextCreate(Font, fontsize, bold, italic, x, y, color, text, shadow, show)
{
	global TextCreate_func
	res := DllCall(TextCreate_func,AStr,Font,Int,fontsize,UChar,bold,UChar,italic,Int,x,Int,y,UInt,color,AStr,text,UChar,shadow,UChar,show)
	return res
}

TextDestroy(id)
{
	global TextDestroy_func
	res := DllCall(TextDestroy_func,Int,id)
	return res
}

TextSetShown(id, show)
{
	global TextSetShown_func
	res := DllCall(TextSetShown_func,Int,id,UChar,show)
	return res
}

TextSetString(id,Text)
{
	global TextSetString_func
	res := DllCall(TextSetString_func,Int,id,AStr,Text)
	return res
}

DestroyAllVisual()
{
	global DestroyAllVisual_func
	res := DllCall(DestroyAllVisual_func)
	return res 
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Dworkin]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27052</uri>
			</author>
			<updated>2017-11-07T19:31:48Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=120903#p120903</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: изменить кодировку переменной]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=120902#p120902" />
			<content type="html"><![CDATA[<p>Легче будет через stringreplace символы заменять.</p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2017-11-07T18:43:34Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=120902#p120902</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: изменить кодировку переменной]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=120899#p120899" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>stealzy пишет:</cite><blockquote><p>Почему не на WStr?</p></blockquote></div><p>Потому что я не понимал и написал наобум.<br />Удалил ненужные функции. В Ansi работает, в Unicode нет.<br />Заменил Str, на WStr.<br />И как тут написано <a href="https://lexikos.github.io/v1/docs/commands/DllCall.htm">https://lexikos.github.io/v1/docs/commands/DllCall.htm</a><br />Поставил в конце функций W:<br />&quot;LoadLibraryW&quot;<br />&quot;GetProcAddressW&quot;<br />Может надо что-то еще заменить?<br /></p><div class="codebox"><pre><code>#NoEnv 

PATH_OVERLAY := &quot;D:\test\dx9_overlay.dll&quot;

hModule := DllCall(&quot;LoadLibraryW&quot;, WStr, PATH_OVERLAY)
if(hModule == -1 || hModule == 0)
{
	MsgBox, 48, Error, The dll-file couldn&#039;t be loaded!
	ExitApp
}


Init_func := DllCall(&quot;GetProcAddressW&quot;, UInt, hModule, WStr, &quot;Init&quot;)
SetParam_func := DllCall(&quot;GetProcAddressW&quot;, UInt, hModule, WStr, &quot;SetParam&quot;)
TextCreate_func := DllCall(&quot;GetProcAddressW&quot;, UInt, hModule, WStr, &quot;TextCreate&quot;)
DestroyAllVisual_func := DllCall(&quot;GetProcAddressW&quot;, UInt, hModule, WStr, &quot;DestroyAllVisual&quot;)
TextDestroy_func := DllCall(&quot;GetProcAddressW&quot;, UInt, hModule, WStr, &quot;TextDestroy&quot;)
TextSetShown_func := DllCall(&quot;GetProcAddressW&quot;, UInt, hModule, WStr, &quot;TextSetShown&quot;)
TextSetString_func := DllCall(&quot;GetProcAddressW&quot;, UInt, hModule, WStr, &quot;TextSetString&quot;)


Init()
{
	global Init_func
	res := DllCall(Init_func)
	return res
}

SetParam(str_Name, str_Value)
{
	global SetParam_func
	res := DllCall(SetParam_func, WStr, str_Name, WStr, str_Value)
	return res
}

TextCreate(Font, fontsize, bold, italic, x, y, color, text, shadow, show)
{
	global TextCreate_func
	res := DllCall(TextCreate_func,WStr,Font,Int,fontsize,UChar,bold,UChar,italic,Int,x,Int,y,UInt,color,WStr,text,UChar,shadow,UChar,show)
	return res
}

TextDestroy(id)
{
	global TextDestroy_func
	res := DllCall(TextDestroy_func,Int,id)
	return res
}

TextSetShown(id, show)
{
	global TextSetShown_func
	res := DllCall(TextSetShown_func,Int,id,UChar,show)
	return res
}

TextSetString(id,Text)
{
	global TextSetString_func
	res := DllCall(TextSetString_func,Int,id,WStr,Text)
	return res
}

DestroyAllVisual()
{
	global DestroyAllVisual_func
	res := DllCall(DestroyAllVisual_func)
	return res 
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Dworkin]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27052</uri>
			</author>
			<updated>2017-11-07T17:43:59Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=120899#p120899</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: изменить кодировку переменной]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=120897#p120897" />
			<content type="html"><![CDATA[<p>Кстати я думаю что библиотека не работает с unicode из-за DllCall.<br /><a href="https://github.com/agrippa1994/DX9-Overlay-API/blob/master/include/ahk/overlay.ahk">https://github.com/agrippa1994/DX9-Over … verlay.ahk</a><br />Можете пожалуйста глянуть и сказать можно ли сделать что бы работало на Unicode? Я имею виду типо заменить str на ptr к примеру. И сказать что по заменять.</p>]]></content>
			<author>
				<name><![CDATA[Dworkin]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27052</uri>
			</author>
			<updated>2017-11-07T16:22:00Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=120897#p120897</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: изменить кодировку переменной]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=120896#p120896" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>YMP пишет:</cite><blockquote><p>Я имел в виду указать кодировку + убрать ваш скрипт для перекодирования.</p></blockquote></div><p>Я в скрипте вывожу то что получаю от api, а затем вывожу после перекодирования что бы увидеть разницу. FileEncoding не помогло.</p><p>Я так же сохранил код в текстовый документ .txt, а затем сохранял как .ahk выбирая разную кодировку. Не помогло.</p>]]></content>
			<author>
				<name><![CDATA[Dworkin]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27052</uri>
			</author>
			<updated>2017-11-07T16:09:24Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=120896#p120896</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: изменить кодировку переменной]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=120884#p120884" />
			<content type="html"><![CDATA[<p>У меня как-то автоматически переводилась кодировка из CP28591 в CP1251.</p>]]></content>
			<author>
				<name><![CDATA[svoboden]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=34280</uri>
			</author>
			<updated>2017-11-07T10:44:15Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=120884#p120884</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: изменить кодировку переменной]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=120878#p120878" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>Dworkin пишет:</cite><blockquote><p>Я и указывал и убирал. Вопросики так и остались.</p></blockquote></div><p>Я имел в виду указать кодировку + убрать ваш скрипт для перекодирования.</p>]]></content>
			<author>
				<name><![CDATA[YMP]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=81</uri>
			</author>
			<updated>2017-11-07T09:25:38Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=120878#p120878</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: изменить кодировку переменной]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=120877#p120877" />
			<content type="html"><![CDATA[<p>Неудивительно, так как у вас изначальная кодировка &quot;СЃР°РјРїРёРє&quot; - 1251.<br />А у автора &quot;ÑÐ°Ð¼Ð¿Ð¸Ðº&quot; - 28591.</p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2017-11-07T09:17:51Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=120877#p120877</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: изменить кодировку переменной]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=120876#p120876" />
			<content type="html"><![CDATA[<p>У меня все работает, если CP1251 поставить вместо CP28591.<br />string := &quot;СЃР°РјРїРёРє&quot;.</p>]]></content>
			<author>
				<name><![CDATA[svoboden]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=34280</uri>
			</author>
			<updated>2017-11-07T09:11:01Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=120876#p120876</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: изменить кодировку переменной]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=120874#p120874" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>YMP пишет:</cite><blockquote><p>Если вы указали FileEncoding, как UTF-8, то ваш скрипт перекодирования уже не надо использовать. Он всё испортит.</p></blockquote></div><p>Я и указывал и убирал. Вопросики так и остались.<br /></p><div class="quotebox"><cite>Malcev пишет:</cite><blockquote><p>А зачем вы используете Ansi версию?</p></blockquote></div><p>Одна библиотека которая мне нужна работает только на анси версии.</p>]]></content>
			<author>
				<name><![CDATA[Dworkin]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27052</uri>
			</author>
			<updated>2017-11-07T08:44:15Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=120874#p120874</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: изменить кодировку переменной]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=120873#p120873" />
			<content type="html"><![CDATA[<p><strong>svoboden</strong>, и что должно получиться?<br /></p><div class="codebox"><pre><code>string := &quot;ÑÐ°Ð¼Ð¿Ð¸Ðº&quot;
VarSetCapacity(ansi, StrPut(string, &quot;CP28591&quot;)), StrPut(string, &amp;ansi, &quot;CP28591&quot;)
string := StrGet(&amp;ansi, &quot;UTF-8&quot;)
msgbox % string
exitapp</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2017-11-07T07:29:41Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=120873#p120873</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: изменить кодировку переменной]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=120872#p120872" />
			<content type="html"><![CDATA[<p>CP1251 поставьте вместо CP28591.</p>]]></content>
			<author>
				<name><![CDATA[svoboden]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=34280</uri>
			</author>
			<updated>2017-11-07T07:24:40Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=120872#p120872</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: изменить кодировку переменной]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=120871#p120871" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>Dworkin пишет:</cite><blockquote><p>В самом верху писал &quot;FileEncoding, CP28591&quot;, CP65001 и др...Без изменений.</p></blockquote></div><p>Если вы указали FileEncoding, как UTF-8, то ваш скрипт перекодирования уже не надо использовать. Он всё испортит.</p>]]></content>
			<author>
				<name><![CDATA[YMP]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=81</uri>
			</author>
			<updated>2017-11-07T04:59:03Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=120871#p120871</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: изменить кодировку переменной]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=120870#p120870" />
			<content type="html"><![CDATA[<p>А зачем вы используете Ansi версию?</p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2017-11-07T03:59:08Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=120870#p120870</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: изменить кодировку переменной]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=120866#p120866" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>KusochekDobra пишет:</cite><blockquote><p><em>FileEncoding [, Encoding]</em> - устанавливается в секции автовыполнения, там же где и все директивы и указания настроек поведения скрипта. Пробовали ставить?</p></blockquote></div><p>В самом верху писал &quot;FileEncoding, CP28591&quot;, CP65001 и др...Без изменений.</p>]]></content>
			<author>
				<name><![CDATA[Dworkin]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27052</uri>
			</author>
			<updated>2017-11-07T00:38:25Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=120866#p120866</id>
		</entry>
</feed>
