<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>JonnyReeves.co.uk &#187; acute</title>
	<atom:link href="http://www.jonnyreeves.co.uk/tag/acute/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.jonnyreeves.co.uk</link>
	<description>Actionscript, Flash, PHP and stuff</description>
	<lastBuildDate>Mon, 19 Jul 2010 15:36:14 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Actionscript &#8211; Loading Acute and UTF-8 Characters from XML into Dynamic Text with Flash</title>
		<link>http://www.jonnyreeves.co.uk/2008/06/actionscript-acute-utf-8-data-xml-flash/</link>
		<comments>http://www.jonnyreeves.co.uk/2008/06/actionscript-acute-utf-8-data-xml-flash/#comments</comments>
		<pubDate>Thu, 19 Jun 2008 09:17:32 +0000</pubDate>
		<dc:creator>Jonny</dc:creator>
				<category><![CDATA[ActionScript 2]]></category>
		<category><![CDATA[actionscript]]></category>
		<category><![CDATA[acute]]></category>
		<category><![CDATA[dynamic text]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[unicode]]></category>

		<guid isPermaLink="false">http://www.jonnyreeves.co.uk/?p=54</guid>
		<description><![CDATA[Writing flexible applications in Flash is easy, (/me points in the direction of my XML Configuration Class) and there&#8217;s few reasons why all your text strings should not be read in at run time to allow for easy internationalization.
However, one pitfall to be aware of is trying to use Acutes and other &#8220;non-latin&#8221; characters in [...]]]></description>
			<content:encoded><![CDATA[<p>Writing flexible applications in Flash is easy, (/me points in the direction of my <a href="http://www.jonnyreeves.co.uk/2008/06/actionscript-20-configuration-class/">XML Configuration Class</a>) and there&#8217;s few reasons why all your text strings should not be read in at run time to allow for easy internationalization.</p>
<p>However, one pitfall to be aware of is trying to use Acutes and other &#8220;non-latin&#8221; characters in dynamic text fields (é, etc).  I was having a problem when these characters were not only not showing up, but all characters after the acute were being truncated!  Here&#8217;s my configuration XML:</p>
<div class="dean_ch" style="white-space: nowrap; overflow: scroll;">
<span class="sc3"><span class="re1">&lt;?xml</span> <span class="re0">version</span>=<span class="st0">&quot;1.0&quot;</span> <span class="re0">encoding</span>=<span class="st0">&quot;UTF-8&quot;</span> <span class="re2">?&gt;</span></span><br />
<span class="sc3"><span class="re1">&lt;configuration<span class="re2">&gt;</span></span></span><br />
&nbsp;<span class="sc3"><span class="re1">&lt;textValue<span class="re2">&gt;</span></span></span>armén<span class="sc3"><span class="re1">&lt;/textValue<span class="re2">&gt;</span></span></span><br />
&nbsp;<span class="sc3"><span class="re1">&lt;/configuration<span class="re2">&gt;</span></span></span><br />
&nbsp;</div>
<p><em>Side Note: Flash Player 9 appears to ignore the <a href="http://www.w3schools.com/XML/xml_encoding.asp">XML Encoding</a> value specified in XML files, however it&#8217;s good practice to adhere to web standards, so make sure your XML&#8217;s encoding is set to UTF-8</em></p>
<p>The next obvious set is to ensure that you embedding all the required glyphs in your .fla file, you do this by clicking on the <em>Embed&#8230;</em> button for your Dynamic Textfield &#8211; make sure you embed all the Latin characters you need and then specify the acutes and other UTF-8 characters seperatley in the &#8220;include these characters:&#8221; textbox:</p>
<p><img src="http://www.jonnyreeves.co.uk/wp-content/uploads/2008/06/flash-character-embedding.gif" alt="The Character Embedding Dialouge in Flash CS3" title="flash-character-embedding" width="500" height="283" class="aligncenter size-full wp-image-55" /></p>
<p>Now this is where the problem comes in &#8211; when I try to compile and run this flash movie, instead of getting the text <em>armén</em> in my textfield, I get <em>arm</em> with both the acute (é) and any trailing characters truncated (in some cases (as in the screen shot below), I even get some of the trailing XML&#8230; eek!)</p>
<p><img src="http://www.jonnyreeves.co.uk/wp-content/uploads/2008/06/utf-8-dynamic-text-error1.jpg" alt="The UTF-8 Text String \&quot;armén\&quot; is breaking the layout" title="utf-8-dynamic-text-error1" width="442" height="334" class="aligncenter size-full wp-image-57" /></p>
<p>After a bit of head scratching I finally managed to track down the problem: The XML file must be saved as UTF-8 encoding!  (d&#8217;oh!)  However, in tracking down the problem I also discovered another workaround using <a href="http://www.adobe.com/support/flash/action_scripts/actionscript_dictionary/actionscript_dictionary723.html">System.useCodepage</a>.  Setting this value to &#8216;true&#8217; in the first frame of your actionscript will force flash to ignore the character encoding of the XML document.</p>
<p>Hope this saves someone some time.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jonnyreeves.co.uk/2008/06/actionscript-acute-utf-8-data-xml-flash/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
