<?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[Unicode (UTF-16) Literale in UTF-8 String verwenden]]></title><description><![CDATA[<p>Hallo zusammen,</p>
<p>Soweit ich weiß, ist es möglich in einem UTF-8-String UTF-16 Literale zu verwenden.<br />
Diese belegen dann zwar mehr Platz als ein Zeichen, aber in einem String ist das ja glaube ich egal.<br />
Doch diese Strings werden nicht korrekt ausgegeben, da kommen immer komische Zeichen davor.<br />
Kann mir jemande helfen?<br />
lg<br />
Unicoder</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/312484/unicode-utf-16-literale-in-utf-8-string-verwenden</link><generator>RSS for Node</generator><lastBuildDate>Sun, 02 Aug 2026 18:46:40 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/312484.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 06 Jan 2013 11:24:32 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Unicode (UTF-16) Literale in UTF-8 String verwenden on Sun, 06 Jan 2013 11:24:32 GMT]]></title><description><![CDATA[<p>Hallo zusammen,</p>
<p>Soweit ich weiß, ist es möglich in einem UTF-8-String UTF-16 Literale zu verwenden.<br />
Diese belegen dann zwar mehr Platz als ein Zeichen, aber in einem String ist das ja glaube ich egal.<br />
Doch diese Strings werden nicht korrekt ausgegeben, da kommen immer komische Zeichen davor.<br />
Kann mir jemande helfen?<br />
lg<br />
Unicoder</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2286711</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2286711</guid><dc:creator><![CDATA[Unicoder]]></dc:creator><pubDate>Sun, 06 Jan 2013 11:24:32 GMT</pubDate></item><item><title><![CDATA[Reply to Unicode (UTF-16) Literale in UTF-8 String verwenden on Sun, 06 Jan 2013 11:30:55 GMT]]></title><description><![CDATA[<p>Unicoder schrieb:</p>
<blockquote>
<p>Kann mir jemande helfen?</p>
</blockquote>
<p><a href="http://www.c-plusplus.net/forum/200753" rel="nofollow">Du brauchst Hilfe?</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/2286714</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2286714</guid><dc:creator><![CDATA[SeppJ]]></dc:creator><pubDate>Sun, 06 Jan 2013 11:30:55 GMT</pubDate></item><item><title><![CDATA[Reply to Unicode (UTF-16) Literale in UTF-8 String verwenden on Sun, 06 Jan 2013 12:02:33 GMT]]></title><description><![CDATA[<p>Ok, das hier klappt nicht:</p>
<pre><code>#include &lt;iostream&gt;
#include &lt;string&gt;

int main()
{
    std::string string = &quot;Grosses Ae: \u00c4&quot;;

    std::cout &lt;&lt; string;

    return 0;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2286725</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2286725</guid><dc:creator><![CDATA[Unicoder]]></dc:creator><pubDate>Sun, 06 Jan 2013 12:02:33 GMT</pubDate></item><item><title><![CDATA[Reply to Unicode (UTF-16) Literale in UTF-8 String verwenden on Sun, 06 Jan 2013 12:14:52 GMT]]></title><description><![CDATA[<p><a href="http://ideone.com/bnCuob" rel="nofollow">http://ideone.com/bnCuob</a></p>
<p>Vermutlich ist dein Ausgabemedium (deine Konsole) nicht in der Lage (oder wahrscheinlicher: nicht passend eingestellt), um Unicodezeichen anzuzeigen.</p>
<p>Was wird denn stattdessen angezeigt? Wenn da 2 Zeichen Müll stehen, dann interpretiert dein Ausgabegerät die Bytes (Unicode ist schließlich auch nur eine Folge von Bytes (wie alles im Computer), erst die richtige Interpretation macht daraus die passenden Zeichen) als ASCII.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2286731</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2286731</guid><dc:creator><![CDATA[SeppJ]]></dc:creator><pubDate>Sun, 06 Jan 2013 12:14:52 GMT</pubDate></item><item><title><![CDATA[Reply to Unicode (UTF-16) Literale in UTF-8 String verwenden on Sun, 06 Jan 2013 12:14:28 GMT]]></title><description><![CDATA[<p>Ah, ok danke.<br />
Weißt du auch wie ich sie einstelle?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2286734</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2286734</guid><dc:creator><![CDATA[Unicoder]]></dc:creator><pubDate>Sun, 06 Jan 2013 12:14:28 GMT</pubDate></item><item><title><![CDATA[Reply to Unicode (UTF-16) Literale in UTF-8 String verwenden on Sun, 06 Jan 2013 12:15:25 GMT]]></title><description><![CDATA[<p>Unicoder schrieb:</p>
<blockquote>
<p>Ah, ok danke.<br />
Weißt du auch wie ich sie einstelle?</p>
</blockquote>
<p>Kommt auf dein System an. Windows? Linux? Was anderes?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2286735</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2286735</guid><dc:creator><![CDATA[SeppJ]]></dc:creator><pubDate>Sun, 06 Jan 2013 12:15:25 GMT</pubDate></item><item><title><![CDATA[Reply to Unicode (UTF-16) Literale in UTF-8 String verwenden on Sun, 06 Jan 2013 12:20:51 GMT]]></title><description><![CDATA[<p>Ich verwende Windows und als Ausgabe bekomme ich so etwas wie:<br />
|-ä<br />
Das |- sieht aber mehr wie ein Zeichen aus...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2286740</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2286740</guid><dc:creator><![CDATA[Unicoder]]></dc:creator><pubDate>Sun, 06 Jan 2013 12:20:51 GMT</pubDate></item><item><title><![CDATA[Reply to Unicode (UTF-16) Literale in UTF-8 String verwenden on Sun, 06 Jan 2013 13:02:58 GMT]]></title><description><![CDATA[<p>in einem UTF-8 String kann man keine UTF-16 Zeichen verwenden. z.B. hat das Euro Sign unter UTF-8 3 Zeichen 0xE2 0x82 0xAC und unter UTF-16 ein Wide Character 0x20AC</p>
<p><a href="http://www.fileformat.info/info/unicode/char/20ac/index.htm" rel="nofollow">http://www.fileformat.info/info/unicode/char/20ac/index.htm</a></p>
<p>für die Test-Ausgabe auf Konsole am besten jedes Zeichen einzeln als Dezimalwert oder Hexwert ausgeben. alternativ das ganze in eine .txt Datei schreiben und mit Word oder Wordpad öffnen</p>
<p>unter C++11 gibt es außer dem L Prefix auch noch andere ...</p>
<p><a href="http://stackoverflow.com/questions/6794590/how-does-file-encoding-affect-c11-string-literals" rel="nofollow">http://stackoverflow.com/questions/6794590/how-does-file-encoding-affect-c11-string-literals</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/2286750</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2286750</guid><dc:creator><![CDATA[dd++ 0]]></dc:creator><pubDate>Sun, 06 Jan 2013 13:02:58 GMT</pubDate></item><item><title><![CDATA[Reply to Unicode (UTF-16) Literale in UTF-8 String verwenden on Sun, 06 Jan 2013 13:19:49 GMT]]></title><description><![CDATA[<p>Also als Output in einer *.txt geht das wunderbar, auch das €-Zeichen.<br />
UTF-16 Literale in UTF-8 String gehen ja.<br />
Und das mit der Konsole ist nicht so schlimm, da ich meistens sowieso grafisch programmiere. Und wenn ich zu Debug-Zwecken etwas ausgeben muss kann ich ja darauf verzichten.<br />
Vielen Dank an alle!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2286755</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2286755</guid><dc:creator><![CDATA[Unicoder]]></dc:creator><pubDate>Sun, 06 Jan 2013 13:19:49 GMT</pubDate></item><item><title><![CDATA[Reply to Unicode (UTF-16) Literale in UTF-8 String verwenden on Sun, 06 Jan 2013 13:24:30 GMT]]></title><description><![CDATA[<p>Unicoder schrieb:</p>
<blockquote>
<p>UTF-16 Literale in UTF-8 String gehen ja.</p>
</blockquote>
<p>nö.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2286756</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2286756</guid><dc:creator><![CDATA[äääääääh]]></dc:creator><pubDate>Sun, 06 Jan 2013 13:24:30 GMT</pubDate></item><item><title><![CDATA[Reply to Unicode (UTF-16) Literale in UTF-8 String verwenden on Sun, 06 Jan 2013 13:25:42 GMT]]></title><description><![CDATA[<p>Irgendwie doch...<br />
Ich bekomme jedenfalls den Output den ich haben wollte...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2286757</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2286757</guid><dc:creator><![CDATA[Unicoder]]></dc:creator><pubDate>Sun, 06 Jan 2013 13:25:42 GMT</pubDate></item><item><title><![CDATA[Reply to Unicode (UTF-16) Literale in UTF-8 String verwenden on Sun, 06 Jan 2013 14:09:47 GMT]]></title><description><![CDATA[<p>Unicoder schrieb:</p>
<blockquote>
<p>Also als Output in einer *.txt geht das wunderbar, auch das €-Zeichen.<br />
UTF-16 Literale in UTF-8 String gehen ja.<br />
Und das mit der Konsole ist nicht so schlimm, da ich meistens sowieso grafisch programmiere. Und wenn ich zu Debug-Zwecken etwas ausgeben muss kann ich ja darauf verzichten.<br />
Vielen Dank an alle!</p>
</blockquote>
<p>nein gehen sie nicht, das es in der &quot;text&quot; datei ok ausschaut liegt vermutlich daran, dass der editor den string als utf16 erkannt hat.<br />
Kannst ja mal die byte darstellung dir anschauen, wenn es nur 2 bytes sind, dann ist es kein utf-8 (für das Euro zeichen)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2286767</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2286767</guid><dc:creator><![CDATA[firefly]]></dc:creator><pubDate>Sun, 06 Jan 2013 14:09:47 GMT</pubDate></item></channel></rss>