<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>Allegro 5 Unicode textDraw</title>
		<link>http://www.allegro.cc/forums/view/606889</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Mon, 04 Apr 2011 18:18:48 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Hi, I&#39;ve been trying for very long time to somehow manage to print wchart_t string to the screen. This part of documentation if kind of misty, so I had a lot of problems with it. After several hours I found this note:</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p> There are problems with UTF-8 string literals under MSVC.<br /> There appear to be two cases:<br /> 1. It thinks our source file use the local file encoding.  This mostly<br />    works okay: the UTF-8 strings look like strings in an 8-bit charset and<br />    will be passed through directly.  But in other locales (e.g. East Asian)<br />    it won&#39;t work.<br /> 2. If we add a UTF-8 byte order mark (signature) then MSVC will recognise<br />    the source file as UTF-8, but will then try to re-encode the strings<br />    into the local charset.<br /> So, unfortunately, for portability to MSVC, we have to externalise UTF-8<br /> strings or write them out using escape codes.</p></div></div><p>Does it mean that it doesn&#39;t work in Visual Studio at all?</p><p>All i&#39;d like to do is to print simple wchar_t array to the screen. No loading from config files or whatever...</p><p>Thanks a lot.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (APrince)</author>
		<pubDate>Thu, 31 Mar 2011 19:38:34 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>wchar_t isn&#39;t UTF-8.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (gnolam)</author>
		<pubDate>Thu, 31 Mar 2011 19:44:10 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>From stuff I read, using UTF-8 string literals is impossible in MSVC. A5 even disables the example that has those literals because no solution was found.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (SiegeLord)</author>
		<pubDate>Thu, 31 Mar 2011 19:50:38 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Well, if you have wchar_t, all you need to do is convert it to UTF8. I wouldn&#39;t know how to get string literals into wchar_t or how to convert wchar_t to UTF8 - both of those are done outside of Allegro.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Elias)</author>
		<pubDate>Thu, 31 Mar 2011 22:11:52 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Could this work?<br /><a href="http://msdn.microsoft.com/en-us/library/dd374130%28v=vs.85%29.aspx">http://msdn.microsoft.com/en-us/library/dd374130%28v=vs.85%29.aspx</a>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (jmasterx)</author>
		<pubDate>Thu, 31 Mar 2011 22:18:53 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Yeah, so the next step is to get a string literal into an LPCWSTR. I guess you should use the UTF8 BOM and use L&quot;&quot; instead of &quot;&quot; for the string literal, supposedly making VC convert from UTF8 to UTF16 which WideCharToMultiByte can convert back to UTF8 to be passed to Allegro.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Elias)</author>
		<pubDate>Fri, 01 Apr 2011 02:28:13 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Well I&#39;m not fixed to wchar_t, it just seemed to me the best way to ensure some portability (if I decided to port the application to Linux for whatever reason). The thing is there&#39;s another library built atop of the Allegro and must not be dependent on it. So the better way may be to define my own string type (abstract class) which could have conversion methods and than make a child for Allegro which would inherit and override those... Or do you suppose anything rather easier?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (APrince)</author>
		<pubDate>Mon, 04 Apr 2011 16:59:48 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>The issue you quoted only concerns string <b>literals</b> in your source code. There should be no problem if you load the strings in another way (reading from a file).</p><p>And wchar_t all by itself isn&#39;t really portable as it depends on the current locale. If you don&#39;t call setlocale() in your program then wchar_t is limited to 7-bit ASCII since the default locale (&quot;C&quot; locale) of libc supports nothing else. (That&#39;s my understanding at least.)
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Elias)</author>
		<pubDate>Mon, 04 Apr 2011 18:18:48 +0000</pubDate>
	</item>
</rss>
