<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>Problem writing text with al_draw_text</title>
		<link>http://www.allegro.cc/forums/view/609446</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Thu, 02 Feb 2012 00:21:23 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>This is my code:</p><div class="source-code"><div class="toolbar"><span class="button numbers"><b>#</b></span><span class="button select">Select</span><span class="button expand">Expand</span></div><div class="inner"><span class="number"> 1</span>bitmap <span class="k3">=</span> <a href="http://www.allegro.cc/manual/al_load_bitmap"><span class="a">al_load_bitmap</span></a><span class="k2">(</span><span class="s">"font.pcx"</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 2</span>
<span class="number"> 3</span><span class="k1">int</span> ranges<span class="k2">[</span><span class="k2">]</span> <span class="k3">=</span> <span class="k2">{</span><span class="n">0</span>, <span class="n">255</span><span class="k2">}</span><span class="k2">;</span>
<span class="number"> 4</span><a href="http://www.allegro.cc/manual/font"><span class="a">font</span></a> <span class="k3">=</span> <a href="http://www.allegro.cc/manual/al_grab_font_from_bitmap"><span class="a">al_grab_font_from_bitmap</span></a><span class="k2">(</span>programa,<span class="n">1</span>,ranges<span class="k2">)</span><span class="k2">;</span>
<span class="number"> 5</span>
<span class="number"> 6</span><a href="http://www.allegro.cc/manual/al_draw_text"><span class="a">al_draw_text</span></a><span class="k2">(</span><a href="http://www.allegro.cc/manual/font"><span class="a">font</span></a>,color,<span class="n">103</span>,<span class="n">103</span>,<span class="n">0</span>,<span class="s">"Prova de caràcters especials: aàáÀÁ"</span><span class="k2">)</span><span class="k2">;</span>
</div></div><p>


When it founds the first special char: &quot;à&quot; it stops writing text.</p><p>I included those characters on my font... all the chars are there.</p><p>It&#39;s al_draw_text uncapable of writing those special chars or I&#39;m doing something absolutely wrong?</p><p>In fact, the same thing happens to me with al_show_native_message_box, beeing the strings finished when some special character like á, é, í is found.</p><p>I have to change the language code for the whole program or something like that?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Cisco Mir)</author>
		<pubDate>Wed, 01 Feb 2012 19:23:41 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Make sure your strings are UTF-8 encoded for Allegro&#39;s text output.</p><p>However, the native dialogs don&#39;t support UTF-8 (on Windows), so you&#39;ll have to use ASCII for that.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Matthew Leverton)</author>
		<pubDate>Wed, 01 Feb 2012 20:51:37 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>And <span class="source-code"><a href="http://www.allegro.cc/manual/al_set_window_title"><span class="a">al_set_window_title</span></a><span class="k2">(</span><span class="k2">)</span></span> doesn&#39;t work with utf-8 neither...
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (AMCerasoli)</author>
		<pubDate>Wed, 01 Feb 2012 20:55:03 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>None of the Window platform calls support UTF-8 strings. It could, but somebody would have to update Allegro to convert all 8-bit strings into 16-bit Window strings before calling the Win32 API.</p><p>But <span class="source-code"><a href="http://www.allegro.cc/manual/al_draw_text"><span class="a">al_draw_text</span></a><span class="k2">(</span><span class="k2">)</span></span> will work fine if given UTF-8 strings, which is mainly what this thread is about.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Matthew Leverton)</author>
		<pubDate>Wed, 01 Feb 2012 21:14:59 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Then the chars à,á,è,é,i,ï,ò,ó,ù,ú are not UTF-8?</p><p>Because with al_draw_text it finishes writing when it founds a char like those ones, important chars on my language btw!
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Cisco Mir)</author>
		<pubDate>Wed, 01 Feb 2012 21:24:02 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Configure your IDE to save the document UTF-8 encoded. For example in C::B</p><p><span class="remote-thumbnail"><span class="json">{"name":"605530","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/f\/e\/fe7e1946666de65c13a7c1b6af9c9693.png","w":847,"h":304,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/f\/e\/fe7e1946666de65c13a7c1b6af9c9693"}</span><img src="http://www.allegro.cc//djungxnpq2nug.cloudfront.net/image/cache/f/e/fe7e1946666de65c13a7c1b6af9c9693-240.jpg" alt="605530" width="240" height="86" /></span>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (AMCerasoli)</author>
		<pubDate>Wed, 01 Feb 2012 21:33:08 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>The problem is solved, thank you very much! <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Cisco Mir)</author>
		<pubDate>Wed, 01 Feb 2012 23:11:42 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/609446/946282#target">Cisco Mir</a> said:</div><div class="quote"><p> Then the chars à,á,è,é,i,ï,ò,ó,ù,ú are not UTF-8?
</p></div></div><p>UTF-8 is just an encoding. Your editor was probably saving in regular &quot;ASCII&quot; mode. The first 127 characters are identical between UTF-8 and ASCII, which is why most of the letters were working fine. But as soon as something 128 or higher was found, it would have been an invalid UTF-8 encoding, triggering an error.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Matthew Leverton)</author>
		<pubDate>Thu, 02 Feb 2012 00:21:23 +0000</pubDate>
	</item>
</rss>
