Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
0

How do I get Special character Euro symbol € to display ?

Participant ,
Nov 05, 2008 Nov 05, 2008

Copy link to clipboard

Copied

Hi,
How do I get the euro symbol € to display in Flash from PHP file created in DW ?. It does not display it properly. I have simplified the PHP code I have is:

<?php
$msgtoflash = "This is the Euro Symbol &#8364";
print ("&Databaseinfo=$msgtoflash");
?>

The &#8364 is a special character code for HTML.
If I use the $ or £ symbols it works perfectly but not € ?

Thanks,
Paul
TOPICS
Server side applications

Views

3.2K
Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 05, 2008 Nov 05, 2008

Copy link to clipboard

Copied

maith wrote:
> How do I get the euro symbol ? to display in Flash from PHP file created in DW
> ?. It does not display it properly. I have simplified the PHP code I have is:
>
> <?php
> $msgtoflash = "This is the Euro Symbol &#8364";
> print ("&Databaseinfo=$msgtoflash");
> ?>

Flash doesn't understand HTML numeric entitites. You need to use the
Unicode code point. Try this:

$msgtoflash = "This is the Euro Symbol: \u20AC";

--
David Powers, Adobe Community Expert
Author, "The Essential Guide to Dreamweaver CS3" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Nov 06, 2008 Nov 06, 2008

Copy link to clipboard

Copied

Thanks for your reply, but It is still not working.
The data I now get displayed in Flash from PHP is: This is the Euro Symbol: \u20AC

Any other suggestions ?

Thanks,
Paul

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Nov 06, 2008 Nov 06, 2008

Copy link to clipboard

Copied

duplicate msg

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 06, 2008 Nov 06, 2008

Copy link to clipboard

Copied

maith wrote:
> Thanks for your reply, but It is still not working.
> The data I now get displayed in Flash from PHP is: This is the Euro Symbol: \u20AC

I've done some checking and testing. In theory, you should send the
value to Flash like this: %20%AC. However, it displays the wrong symbol.

What does work is using "\u20AC" inside Flash. You might want to
consider embedding the code for the euro symbol in your ActionScript,
and just transmitting the value through PHP.

It's a long time since I have used Flash and PHP together, so if you
need further help, I suggest that you post a request in the ActionScript
or Flash forum.

--
David Powers, Adobe Community Expert
Author, "The Essential Guide to Dreamweaver CS3" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 07, 2008 Nov 07, 2008

Copy link to clipboard

Copied

maith posted in macromedia.dreamweaver.appdev:

> Thanks for your reply, but It is still not working.
> The data I now get displayed in Flash from PHP is: This is the
> Euro Symbol: \u20AC

I can't test right now, but does it help to urlencode first?

$msgtoflash = urlencode("This is the Euro Symbol: \u20AC");

Or perhaps the whole response?

print (urlencode("&Databaseinfo=$msgtoflash"));


--
Mark A. Boyd
Keep-On-Learnin' :)

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 07, 2008 Nov 07, 2008

Copy link to clipboard

Copied

Mark A. Boyd wrote:
> I can't test right now, but does it help to urlencode first?
>
> $msgtoflash = urlencode("This is the Euro Symbol: \u20AC");

Variables sent to Flash should be URL-encoded, but that doesn't work.

> Or perhaps the whole response?
>
> print (urlencode("&Databaseinfo=$msgtoflash"));

That screws everything up completely. The value of the variable should
be URL-encoded, but not the = or &.

--
David Powers, Adobe Community Expert
Author, "The Essential Guide to Dreamweaver CS3" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Nov 12, 2008 Nov 12, 2008

Copy link to clipboard

Copied

Thanks Mark and David for your replys,
unfortunetly urlencode("This is the Euro Symbol: \u20AC"); does not work either.

The PHP file, is connected to mySQL database and that is where the numbers come from. Is there anything in mySQL, that I could do, to display the euro symbol ?

Thanks,
Paul

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 12, 2008 Nov 12, 2008

Copy link to clipboard

Copied

maith wrote:
> The PHP file, is connected to mySQL database and that is where the numbers
> come from. Is there anything in mySQL, that I could do, to display the euro
> symbol ?

It doesn't matter where it comes from; it's what Flash receives that's
the problem. What makes things complicated is the difference between
ActionScript 2.0 and ActionScript 3.0. You don't say which you're using.

The recommended way to get special characters into Flash is to use XML
served as UTF-8. That way, you could load the euro symbol natively into
Flash. However, this isn't the best place for advice on Flash. It's a
long time since I did any work with Flash and PHP, and everything has
changed with ActionScript 3.0. As I said before, you should get more
accurate help in the ActionScript forum.

--
David Powers, Adobe Community Expert
Author, "The Essential Guide to Dreamweaver CS3" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Nov 13, 2008 Nov 13, 2008

Copy link to clipboard

Copied

Thanks David,
Im using Actionscript2. I had placed a query in Flash in "General Discussions", before I came on the Dreamweaver Forum, but got no reply. I will try their Actionscript section, to see if I have any luck there !

Thanks again

Paul

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 13, 2008 Nov 13, 2008

Copy link to clipboard

Copied

LATEST
maith wrote:
> Im using Actionscript2. I had placed a query in Flash in "General
> Discussions", before I came on the Dreamweaver Forum, but got no reply.

The way to get the euro symbol to display in Flash is to use XML. I have
tested this, and it works:

euro.php

<?php
header('Content-type: text/xml');
echo '<root>
<elem>This is the euro symbol: &#8364;</elem>
</root>';
?>

ActionScript 2.0 to display the value of <elem> in a dynamic text field
called myText:

var myXML:XML = new XML();
myXML.ignoreWhite = true;
myXML.onLoad = handleLoad;
myXML.load(' http://localhost/test/euro.php');
function handleLoad(success) {
if (success) {
var theRoot:XMLNode = this.firstChild;
myText.text = theRoot.firstChild.firstChild.nodeValue;
} else {
myText.text = 'Not working :(';
}
}

Handling XML in ActionScript 2.0 is like poking needles in your eyes,
but it's the only way I have been able to get the euro symbol from an
external source into a Flash movie.

--
David Powers, Adobe Community Expert
Author, "The Essential Guide to Dreamweaver CS3" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 09, 2008 Nov 09, 2008

Copy link to clipboard

Copied

David Powers posted in macromedia.dreamweaver.appdev:

> Mark A. Boyd wrote:
>> I can't test right now, but does it help to urlencode first?
>>
>> $msgtoflash = urlencode("This is the Euro Symbol: \u20AC");
>
> Variables sent to Flash should be URL-encoded, but that doesn't
> work.

Thanks.

>> Or perhaps the whole response?
>>
>> print (urlencode("&Databaseinfo=$msgtoflash"));
>
> That screws everything up completely. The value of the variable
> should be URL-encoded, but not the = or &.

Oh, yes of course!


--
Mark A. Boyd
Keep-On-Learnin' :)

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines