<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Text dekodieren]]></title><description><![CDATA[<p>Hallo,</p>
<p>ß =&gt; ß</p>
<p>Wie kann ich sowas dekodieren?</p>
<p>Danke,<br />
Newb</p>
<p>P.S.: Das stammt aus einem xml File, in dem<br />
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; ?&gt;<br />
steht aber Utf-8 kann das nicht sein, denn dafür habe ich schon ne Funktion:</p>
<pre><code class="language-cpp">CString utf8_decode(CString utf8text)
	{
		CString ansitext;

		char m[500];
		WCHAR w[500];

		strcpy(m, utf8text);
		MultiByteToWideChar(CP_UTF8, 0, m, -1, w, sizeof(w) / sizeof(WCHAR));
		WideCharToMultiByte(CP_ACP, 0, w, -1, m, sizeof(m), 0, 0);

		ansitext = m;

		return ansitext;
	}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/173067/text-dekodieren</link><generator>RSS for Node</generator><lastBuildDate>Sun, 26 Apr 2026 05:18:24 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/173067.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 11 Feb 2007 15:16:03 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Text dekodieren on Sun, 11 Feb 2007 15:16:03 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>ß =&gt; ß</p>
<p>Wie kann ich sowas dekodieren?</p>
<p>Danke,<br />
Newb</p>
<p>P.S.: Das stammt aus einem xml File, in dem<br />
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; ?&gt;<br />
steht aber Utf-8 kann das nicht sein, denn dafür habe ich schon ne Funktion:</p>
<pre><code class="language-cpp">CString utf8_decode(CString utf8text)
	{
		CString ansitext;

		char m[500];
		WCHAR w[500];

		strcpy(m, utf8text);
		MultiByteToWideChar(CP_UTF8, 0, m, -1, w, sizeof(w) / sizeof(WCHAR));
		WideCharToMultiByte(CP_ACP, 0, w, -1, m, sizeof(m), 0, 0);

		ansitext = m;

		return ansitext;
	}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1226900</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1226900</guid><dc:creator><![CDATA[New:Newbiw]]></dc:creator><pubDate>Sun, 11 Feb 2007 15:16:03 GMT</pubDate></item><item><title><![CDATA[Reply to Text dekodieren on Sun, 11 Feb 2007 15:17:53 GMT]]></title><description><![CDATA[<p>Misst, der Browser interpretiert das Zeichen schon von allein</p>
<p>UND#223; =&gt; ß</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1226901</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1226901</guid><dc:creator><![CDATA[New:Newbiw]]></dc:creator><pubDate>Sun, 11 Feb 2007 15:17:53 GMT</pubDate></item><item><title><![CDATA[Reply to Text dekodieren on Sun, 11 Feb 2007 16:03:59 GMT]]></title><description><![CDATA[<p>Wenn ich wenigstens wüsste, wie das heißt, womit der Text kodiert ist.</p>
<p>Es ist kein utf-8 aber was ist es?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1226928</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1226928</guid><dc:creator><![CDATA[New:Newbiw]]></dc:creator><pubDate>Sun, 11 Feb 2007 16:03:59 GMT</pubDate></item><item><title><![CDATA[Reply to Text dekodieren on Sun, 11 Feb 2007 16:23:29 GMT]]></title><description><![CDATA[<p>Okay, es handelt sich also um unicode ... wie kriege ich das jetzt in &quot;ü&quot;</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1226938</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1226938</guid><dc:creator><![CDATA[New:Newbiw]]></dc:creator><pubDate>Sun, 11 Feb 2007 16:23:29 GMT</pubDate></item><item><title><![CDATA[Reply to Text dekodieren on Sun, 11 Feb 2007 16:36:07 GMT]]></title><description><![CDATA[<p>vielleicht hilft dir <a href="http://www.html-php-mysql.de/generatoren/unicode.php" rel="nofollow">DAS HIER</a> ?</p>
<p>mfg,<br />
julian</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1226945</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1226945</guid><dc:creator><![CDATA[Julian__]]></dc:creator><pubDate>Sun, 11 Feb 2007 16:36:07 GMT</pubDate></item><item><title><![CDATA[Reply to Text dekodieren on Sun, 11 Feb 2007 17:21:16 GMT]]></title><description><![CDATA[<p>Okay, die Erleuchtung kam spät aber aber sie kam.<br />
Ich habe jetzt selbst eine Funktion geschrieben:</p>
<pre><code class="language-cpp">CString CSherlockDlg::html_decode(CString encodedStr)
	{
		// Variablen
		CString s1, s2, str_code, replace_str,  replace_old;
		int		p1, p2, int_code;

		// Die Event-Schleife
		s1 = &quot;&amp;#&quot;;	s2 = &quot;;&quot;;
		p1 = 0;		p2 = 0;

		while(true)
		{
			p1 = encodedStr.Find(s1, p2);
			p2 = encodedStr.Find(s2, p1+1);

			if(p1==-1 || p2==-1) 
			break;

			if(p2-p1&lt;6)
			{
				// Hier wird das Zeichen als CString gespeichert
				str_code	= encodedStr.Mid(p1+s1.GetLength(),p2-p1-s1.GetLength());
				p2			= p2+1;

				// Hier wird das Zeichen als int gespeichert
				int_code	= atoi( (LPCTSTR) str_code );

				// Konvertierung von int-Zeichen nach CString
				replace_str = (CString) int_code;

				// Die Zeichen, die ersetzt werden sollen
				replace_old = s1+str_code+s2;

				// Hier wird das Zeichen ersetzt
				encodedStr.Replace(replace_old,replace_str);
			}
		}

		return encodedStr;
	}
</code></pre>
<p>Bye bye,<br />
Michael</p>
<p>P.S.:<br />
Bei Fragen zur Funktion: <a href="mailto:Hecker.Michae@gmx.de" rel="nofollow">Hecker.Michae@gmx.de</a>&quot;&gt;<a href="mailto:Hecker.Michae@gmx.de" rel="nofollow">Hecker.Michae@gmx.de</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1226966</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1226966</guid><dc:creator><![CDATA[New:Newbiw]]></dc:creator><pubDate>Sun, 11 Feb 2007 17:21:16 GMT</pubDate></item><item><title><![CDATA[Reply to Text dekodieren on Sun, 11 Feb 2007 17:22:20 GMT]]></title><description><![CDATA[<p><a href="mailto:Hecker.Michael@gmx.de" rel="nofollow">Hecker.Michael@gmx.de</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1226967</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1226967</guid><dc:creator><![CDATA[New:Newbiw]]></dc:creator><pubDate>Sun, 11 Feb 2007 17:22:20 GMT</pubDate></item><item><title><![CDATA[Reply to Text dekodieren on Sun, 11 Feb 2007 17:39:10 GMT]]></title><description><![CDATA[<p>Ich hatte noch einen kleinen Bug drin.<br />
Hier jetzt die fertige Funktion:</p>
<pre><code class="language-cpp">CString html_decode(CString encodedStr)
	{
		// Variablen
		CString s1, s2, str_code, replace_str,  replace_old;
		int		p1, p2, int_code;

		// Die Event-Schleife
		s1 = &quot;&amp;#&quot;;	s2 = &quot;;&quot;;
		p1 = 0;		p2 = 0;

		while(true)
		{
			p1 = encodedStr.Find(s1, 0);
			p2 = encodedStr.Find(s2, p1);

			if(p1==-1 || p2==-1) 
			break;

			if(p2-p1&lt;6)
			{
				// Hier wird das Zeichen als CString gespeichert
				str_code	= encodedStr.Mid(p1+s1.GetLength(),p2-p1-s1.GetLength());

				// Hier wird das Zeichen als int gespeichert
				int_code	= atoi( (LPCTSTR) str_code );

				// Konvertierung von int-Zeichen nach CString
				replace_str = (CString) int_code;

				// Die Zeichen, die ersetzt werden sollen
				replace_old = s1+str_code+s2;

				// Hier wird das Zeichen ersetzt
				encodedStr.Replace(replace_old,replace_str);
			}
		}

		return encodedStr;
	}
</code></pre>
<p>Liebe Grüße,<br />
Michael</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1226980</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1226980</guid><dc:creator><![CDATA[New:Newbiw]]></dc:creator><pubDate>Sun, 11 Feb 2007 17:39:10 GMT</pubDate></item><item><title><![CDATA[Reply to Text dekodieren on Sun, 11 Feb 2007 18:09:02 GMT]]></title><description><![CDATA[<p>Hab es mal kurz für STL Benutzer umgeschrieben ^^ Ist ein wenig kürzer ... wenn wahrscheinlich auch ein wenig ineffizient ... und ist ungetestet ... nur reingetippt ... sorry</p>
<pre><code class="language-cpp">void html_decode(std::string&amp; string)
{
	std::string::size_type	pos_begin		= std::string::npos;
	std::string::size_type	pos_end			= std::string::npos;
	std::string				string_letter;
	std::string				string_replace;

	while (((pos_begin = string.find_first_of(&quot;&amp;#&quot;, 0)) != std::string::npos) &amp;&amp; ((pos_end = string.find_first_of(';', pos_begin)) != std::string::npos))
	{
		if ((pos_end - pos_begin) &lt; 6)
		{
			string_letter	= string.substr(pos_begin + 2, pos_end);
			string_replace	= (char)atoi(string_letter.c_str());
			string.replace(pos_begin, pos_end - pos_begin, string_replace);
		}
	}
}
</code></pre>
<p>Aja so wird man auch keine Fehlermeldung erhalten von wegen condition constant ...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1226993</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1226993</guid><dc:creator><![CDATA[*D*Evil]]></dc:creator><pubDate>Sun, 11 Feb 2007 18:09:02 GMT</pubDate></item></channel></rss>