<?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=13171</link>
		<atom:link href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=13171&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «AHK: изменить кодировку переменной».]]></description>
		<lastBuildDate>Tue, 07 Nov 2017 19:31:48 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: AHK: изменить кодировку переменной]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=120903#p120903</link>
			<description><![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>]]></description>
			<author><![CDATA[null@example.com (Dworkin)]]></author>
			<pubDate>Tue, 07 Nov 2017 19:31:48 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=120903#p120903</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: изменить кодировку переменной]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=120902#p120902</link>
			<description><![CDATA[<p>Легче будет через stringreplace символы заменять.</p>]]></description>
			<author><![CDATA[null@example.com (Malcev)]]></author>
			<pubDate>Tue, 07 Nov 2017 18:43:34 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=120902#p120902</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: изменить кодировку переменной]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=120899#p120899</link>
			<description><![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>]]></description>
			<author><![CDATA[null@example.com (Dworkin)]]></author>
			<pubDate>Tue, 07 Nov 2017 17:43:59 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=120899#p120899</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: изменить кодировку переменной]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=120897#p120897</link>
			<description><![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>]]></description>
			<author><![CDATA[null@example.com (Dworkin)]]></author>
			<pubDate>Tue, 07 Nov 2017 16:22:00 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=120897#p120897</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: изменить кодировку переменной]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=120896#p120896</link>
			<description><![CDATA[<div class="quotebox"><cite>YMP пишет:</cite><blockquote><p>Я имел в виду указать кодировку + убрать ваш скрипт для перекодирования.</p></blockquote></div><p>Я в скрипте вывожу то что получаю от api, а затем вывожу после перекодирования что бы увидеть разницу. FileEncoding не помогло.</p><p>Я так же сохранил код в текстовый документ .txt, а затем сохранял как .ahk выбирая разную кодировку. Не помогло.</p>]]></description>
			<author><![CDATA[null@example.com (Dworkin)]]></author>
			<pubDate>Tue, 07 Nov 2017 16:09:24 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=120896#p120896</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: изменить кодировку переменной]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=120884#p120884</link>
			<description><![CDATA[<p>У меня как-то автоматически переводилась кодировка из CP28591 в CP1251.</p>]]></description>
			<author><![CDATA[null@example.com (svoboden)]]></author>
			<pubDate>Tue, 07 Nov 2017 10:44:15 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=120884#p120884</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: изменить кодировку переменной]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=120878#p120878</link>
			<description><![CDATA[<div class="quotebox"><cite>Dworkin пишет:</cite><blockquote><p>Я и указывал и убирал. Вопросики так и остались.</p></blockquote></div><p>Я имел в виду указать кодировку + убрать ваш скрипт для перекодирования.</p>]]></description>
			<author><![CDATA[null@example.com (YMP)]]></author>
			<pubDate>Tue, 07 Nov 2017 09:25:38 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=120878#p120878</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: изменить кодировку переменной]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=120877#p120877</link>
			<description><![CDATA[<p>Неудивительно, так как у вас изначальная кодировка &quot;СЃР°РјРїРёРє&quot; - 1251.<br />А у автора &quot;ÑÐ°Ð¼Ð¿Ð¸Ðº&quot; - 28591.</p>]]></description>
			<author><![CDATA[null@example.com (Malcev)]]></author>
			<pubDate>Tue, 07 Nov 2017 09:17:51 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=120877#p120877</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: изменить кодировку переменной]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=120876#p120876</link>
			<description><![CDATA[<p>У меня все работает, если CP1251 поставить вместо CP28591.<br />string := &quot;СЃР°РјРїРёРє&quot;.</p>]]></description>
			<author><![CDATA[null@example.com (svoboden)]]></author>
			<pubDate>Tue, 07 Nov 2017 09:11:01 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=120876#p120876</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: изменить кодировку переменной]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=120874#p120874</link>
			<description><![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>]]></description>
			<author><![CDATA[null@example.com (Dworkin)]]></author>
			<pubDate>Tue, 07 Nov 2017 08:44:15 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=120874#p120874</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: изменить кодировку переменной]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=120873#p120873</link>
			<description><![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>]]></description>
			<author><![CDATA[null@example.com (Malcev)]]></author>
			<pubDate>Tue, 07 Nov 2017 07:29:41 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=120873#p120873</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: изменить кодировку переменной]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=120872#p120872</link>
			<description><![CDATA[<p>CP1251 поставьте вместо CP28591.</p>]]></description>
			<author><![CDATA[null@example.com (svoboden)]]></author>
			<pubDate>Tue, 07 Nov 2017 07:24:40 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=120872#p120872</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: изменить кодировку переменной]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=120871#p120871</link>
			<description><![CDATA[<div class="quotebox"><cite>Dworkin пишет:</cite><blockquote><p>В самом верху писал &quot;FileEncoding, CP28591&quot;, CP65001 и др...Без изменений.</p></blockquote></div><p>Если вы указали FileEncoding, как UTF-8, то ваш скрипт перекодирования уже не надо использовать. Он всё испортит.</p>]]></description>
			<author><![CDATA[null@example.com (YMP)]]></author>
			<pubDate>Tue, 07 Nov 2017 04:59:03 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=120871#p120871</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: изменить кодировку переменной]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=120870#p120870</link>
			<description><![CDATA[<p>А зачем вы используете Ansi версию?</p>]]></description>
			<author><![CDATA[null@example.com (Malcev)]]></author>
			<pubDate>Tue, 07 Nov 2017 03:59:08 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=120870#p120870</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: изменить кодировку переменной]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=120866#p120866</link>
			<description><![CDATA[<div class="quotebox"><cite>KusochekDobra пишет:</cite><blockquote><p><em>FileEncoding [, Encoding]</em> - устанавливается в секции автовыполнения, там же где и все директивы и указания настроек поведения скрипта. Пробовали ставить?</p></blockquote></div><p>В самом верху писал &quot;FileEncoding, CP28591&quot;, CP65001 и др...Без изменений.</p>]]></description>
			<author><![CDATA[null@example.com (Dworkin)]]></author>
			<pubDate>Tue, 07 Nov 2017 00:38:25 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=120866#p120866</guid>
		</item>
	</channel>
</rss>
