French text + urlencoding + html

Back again with a tricky issue concerning encoding, font embedding, HTML & PHP. The situation:

  1. I’m loading text into a dynamic textfield (with HTML parsing turned on) in flash MX using PHP. That works fine. To send one big textstream I usually do a rawurlencode() or urlencode() in PHP. Flash displays simple HTML stuff like a linebreak or font color correctly.

  2. But I do not seem to get any “special” characters in that textfield. Fact is that some of texts being displayed are in French.
    Flash MX does not seem to parse those characters correctly [é à è] etc.

  3. On the Macromedia website it is recommended to use urlencoding (http://www.macromedia.com/support/flash/ts/documents/url_encoding.htm), with the corresponding codes.

  4. I’ve tried turning off all HTML funcionality just to get the accented chars right, but I don’t see them in Flash. Font embedding doesn’t change a thing either.

  5. I’ve also tried to send just one simple HTML string to the HTML textfield that should generate an “e accent aigue” using htmlentities() -> &ecaute;
    But that doesn’t seem to work either.

  6. Note: I’m not using any bizar font (just an Arial, Tahoma or Verdana) & I do understand there are two issues here: HTML / encoding.

HELP MUCH APPRECIATED!!
It’s probably not all that difficult.

Works fine for me, i use

$message = htmlspecialchars($message);

to insert posts into the database, and

$message = HTMLSpecialChars($post[‘message’]);

to retrieve the stuff from the database before sending it to flash with

$output .= “Message=” . urlencode($message);

See test at
http://eyezberg.free.fr/forum/index2.html
select “Test Forum” > test specialchars…

aucun problème! Si ça marche pas, envoie moi tes sources…

Je suis désolé… mais je ne vois rien sur ton site (beau !)… mais je pense d’avoir trouvé une solution.

Flash MX is fully utf8 compliant. In PHP you can do a utf8_encode($yourstring); and it will show your French text with all the accents correclty, including all HTML functionality! That seems to work.

URL encoding as described in Flash does not produce the same results as in PHP.

I was hopeless with urlencode function, because when I use flash 5, the text output was fine, however, with flash MX, the text output was not correct… like " G� " and not “Gómez”

I used utf8_encode function for my spanish text, with á, í, … and it works fine…

tanks (Gracias)