<?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[UTF-8 in UTF-16 umwandeln]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich versuche grade eine UTF-8 Textdatei per ReadFile einzulesen und diesen Text dann z.B. per DrawTextW auszugeben. Allerdings nutzen die ganzen Windows Unicode-Funktionen UTF-16. Wie kann ich das am sinnvollsten hin- und her-umwandeln?</p>
<p>Soweit ich das verstanden habe ist MultibyteToWidechar eigentlich für das Umwandeln von ANSI nach Unicode gedacht, aber UTF-8 ist ja bereits Unicode.</p>
<p>Wie krieg ich das am besten hin?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/196532/utf-8-in-utf-16-umwandeln</link><generator>RSS for Node</generator><lastBuildDate>Tue, 16 Jun 2026 16:21:41 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/196532.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 30 Oct 2007 22:50:29 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to UTF-8 in UTF-16 umwandeln on Tue, 30 Oct 2007 22:50:29 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich versuche grade eine UTF-8 Textdatei per ReadFile einzulesen und diesen Text dann z.B. per DrawTextW auszugeben. Allerdings nutzen die ganzen Windows Unicode-Funktionen UTF-16. Wie kann ich das am sinnvollsten hin- und her-umwandeln?</p>
<p>Soweit ich das verstanden habe ist MultibyteToWidechar eigentlich für das Umwandeln von ANSI nach Unicode gedacht, aber UTF-8 ist ja bereits Unicode.</p>
<p>Wie krieg ich das am besten hin?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1394940</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1394940</guid><dc:creator><![CDATA[UTF]]></dc:creator><pubDate>Tue, 30 Oct 2007 22:50:29 GMT</pubDate></item><item><title><![CDATA[Reply to UTF-8 in UTF-16 umwandeln on Wed, 31 Oct 2007 08:38:03 GMT]]></title><description><![CDATA[<p>MultibyteToWidechar ist für das Umwandeln von &quot;Multibyte&quot; nach &quot;Widechar&quot; (wer hätte das gedacht...)<br />
Deshalb ist es genau das richtige...<br />
Die Codepage (erster Parameter) ist dann logischerweise: CP_UTF8</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1395007</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1395007</guid><dc:creator><![CDATA[Jochen Kalmbach]]></dc:creator><pubDate>Wed, 31 Oct 2007 08:38:03 GMT</pubDate></item><item><title><![CDATA[Reply to UTF-8 in UTF-16 umwandeln on Wed, 31 Oct 2007 10:47:39 GMT]]></title><description><![CDATA[<p>UTF-8 ist ein Multibyte Zeichensatz, da die Anzahl der Bytes pro Zeichen variieren kann. UTF-16 oder UCS-2 (Unicode) hat dagegen eine feste Anzahl an Bytes pro Zeichen, nämlich zwei wie ein <em>wchar_t</em>. Deshalb musst du MultiByteToWideChar verwenden.</p>
<p>Das nur mal nebenbei.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1395103</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1395103</guid><dc:creator><![CDATA[yogle]]></dc:creator><pubDate>Wed, 31 Oct 2007 10:47:39 GMT</pubDate></item><item><title><![CDATA[Reply to UTF-8 in UTF-16 umwandeln on Wed, 31 Oct 2007 12:19:02 GMT]]></title><description><![CDATA[<p>... UCS-2 hat genau 2-Bytes pro Codepoint.<br />
UTF-16 hat hingegen 2 oder 4 Bytes, je nach Surrogate...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1395159</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1395159</guid><dc:creator><![CDATA[Jochen Kalmbach]]></dc:creator><pubDate>Wed, 31 Oct 2007 12:19:02 GMT</pubDate></item><item><title><![CDATA[Reply to UTF-8 in UTF-16 umwandeln on Wed, 31 Oct 2007 12:57:53 GMT]]></title><description><![CDATA[<p>Aha wieder was gelernt. Warum gibt es bei MultiByteToWideChar/WideCharToMultiByte keine Möglichkeit auf UTF-16 zu konvertieren?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1395198</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1395198</guid><dc:creator><![CDATA[yogle]]></dc:creator><pubDate>Wed, 31 Oct 2007 12:57:53 GMT</pubDate></item><item><title><![CDATA[Reply to UTF-8 in UTF-16 umwandeln on Wed, 31 Oct 2007 13:27:29 GMT]]></title><description><![CDATA[<p>WideChar ist unter Windows immer UTF-16 (bzw. UCS-2)... somit wandelt MultiByteToWideChar immer nach UTF-16 (UCS-2).</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1395219</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1395219</guid><dc:creator><![CDATA[Jochen Kalmbach]]></dc:creator><pubDate>Wed, 31 Oct 2007 13:27:29 GMT</pubDate></item></channel></rss>