<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Форум Рутокен &mdash; Не верная кодировка полей сертификата]]></title>
		<link>https://forum.rutoken.ru/topic/4076/</link>
		<atom:link href="https://forum.rutoken.ru/feed/rss/topic/4076/" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «Не верная кодировка полей сертификата».]]></description>
		<lastBuildDate>Sat, 10 May 2025 13:40:21 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Не верная кодировка полей сертификата]]></title>
			<link>https://forum.rutoken.ru/post/27901/#p27901</link>
			<description><![CDATA[<p><strong>anzhelatursunova</strong>, здравствуйте.<br />В панели форматирования самый правый значок &quot;Загрузите изображение...&quot;<br />Если возникают сложности, вы можете отправить вопрос на <span class="bbu">hotline@rutoken.ru</span>.</p>]]></description>
			<author><![CDATA[null@example.com (Вотинов Александр)]]></author>
			<pubDate>Sat, 10 May 2025 13:40:21 +0000</pubDate>
			<guid>https://forum.rutoken.ru/post/27901/#p27901</guid>
		</item>
		<item>
			<title><![CDATA[Re: Не верная кодировка полей сертификата]]></title>
			<link>https://forum.rutoken.ru/post/27900/#p27900</link>
			<description><![CDATA[<p>Как подгрузить фото ?</p>]]></description>
			<author><![CDATA[null@example.com (anzhelatursunova)]]></author>
			<pubDate>Fri, 09 May 2025 11:27:11 +0000</pubDate>
			<guid>https://forum.rutoken.ru/post/27900/#p27900</guid>
		</item>
		<item>
			<title><![CDATA[Re: Не верная кодировка полей сертификата]]></title>
			<link>https://forum.rutoken.ru/post/21898/#p21898</link>
			<description><![CDATA[<p>Спасибо, с консолью был просто пример, так то нужно вывести в окно винапи<br />Но вы подсказали, что строка в кодировке utf-8<br />Написал функцию перевода, все работает, спасибо<br />Может кому то пригодиться<br /></p><div class="codebox"><pre><code>// Переводим в ANSI
int stringToANSI(std::string src, std::string&amp; strANSI)
{
    int size = MultiByteToWideChar(CP_UTF8, NULL, src.c_str(), src.length(), NULL, NULL);
    if (size == 0)
    {
        return 1;
    }

    std::wstring w_str(size, 0);
    int err = MultiByteToWideChar(CP_UTF8, NULL, src.c_str(), src.length(), &amp;w_str[0], size);
    if (err == 0)
    {
        return 2;
    }

    int strANSI_size = WideCharToMultiByte(CP_ACP, NULL, w_str.c_str(), w_str.length(), NULL, NULL, NULL, NULL);
    if (strANSI_size == 0)
    {
        return 3;
    }

    std::string ANSI_str(strANSI_size, 0);
    err = WideCharToMultiByte(CP_ACP, NULL, w_str.c_str(), ANSI_str.length(), &amp;ANSI_str[0], strANSI_size, NULL, NULL);
    if (err == 0)
    {
        return 4;
    }

    strANSI = ANSI_str;

    return 0;
}</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (regnor)]]></author>
			<pubDate>Thu, 26 Oct 2023 06:46:16 +0000</pubDate>
			<guid>https://forum.rutoken.ru/post/21898/#p21898</guid>
		</item>
		<item>
			<title><![CDATA[Re: Не верная кодировка полей сертификата]]></title>
			<link>https://forum.rutoken.ru/post/21897/#p21897</link>
			<description><![CDATA[<p>Добрый день!<br />Спасибо за внимание к интерфейсу pki-core-cpp!<br />Как оказалось, возвращаемые строки в кодировке utf-8.<br />Этот совет со стековерфлоу решает вашу проблему: <a href="https://stackoverflow.com/a/77225440/2373171">https://stackoverflow.com/a/77225440/2373171</a></p><div class="codebox"><pre><code>#include &lt;iostream&gt;
#include &lt;string&gt;
#ifdef _WIN32
#include &lt;windows.h&gt;
#include &lt;clocale&gt;
#endif

int main() {
#ifdef _WIN32
  // console UTF-8
  std::setlocale(LC_CTYPE, &quot;.UTF8&quot;);
  SetConsoleOutputCP(CP_UTF8);
  SetConsoleCP(CP_UTF8);
#endif

  std::string str = &quot;&quot;;
  std::cout &lt;&lt; str &lt;&lt; std::endl;

  return 0;
}</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Евгений Мироненко)]]></author>
			<pubDate>Wed, 25 Oct 2023 15:43:42 +0000</pubDate>
			<guid>https://forum.rutoken.ru/post/21897/#p21897</guid>
		</item>
		<item>
			<title><![CDATA[Не верная кодировка полей сертификата]]></title>
			<link>https://forum.rutoken.ru/post/21892/#p21892</link>
			<description><![CDATA[<p>Доброго времени суток<br />Пытался получить владельца сертификата, владелец фирма, название на русском языке, в итоге получаю иероглифы<br />Понятно, что дело в кодировке, но я не пойму как починить, пробовал конвертить в вчары, не помогло<br />В драйвере отображается все нормально<br />Подскажите в чем дело?</p><p>Сделал минимальный пример для демонстрации проблемы, ссылка гугл диск<br /><a href="https://drive.google.com/file/d/1yeNOwzBe2sNok7F88RrDmeP0ODVOg914/view?usp=sharing">https://drive.google.com/file/d/1yeNOwz … sp=sharing</a></p>]]></description>
			<author><![CDATA[null@example.com (regnor)]]></author>
			<pubDate>Wed, 25 Oct 2023 11:17:26 +0000</pubDate>
			<guid>https://forum.rutoken.ru/post/21892/#p21892</guid>
		</item>
	</channel>
</rss>
