note 26579 added to function.urlencode
| From: | leckermatz at rack1 dot php dot net | Date: | Tue, 05 Nov 2002 19:16:09 +0000 |
| Subject: | note 26579 added to function.urlencode | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-39005@lists.php.net to get a copy of this message | ||
Addendum: In Flash 6 there finally is a working method of passing special characters into a flash
movie.In order to do this, the php file which generaes the output (an is adressen in flash via the
"loadVariables" action) must be saved as an UTF-8 encoded file. By doing so, the file will
gain an BOM and will be properly recognized as UTF8-encoded by the flash movie.
Now all you need to do is something like
echo "textvar=".urlencode(utf8_encode("lots of special chars: äöü..."));
and that should work fine.
another thing:
Flash interprets both \r and \n as newline commands. Therefore ot will insert 2 line breaks whenever
there is only one. i.e., nl2br($string) will NOT work properly. Better use a function that will
replace "\n" values from your database with "<br />" rather than
"<br />\r", as nl2br would do. Example:
function nltobr($input)
{
$input=nl2br($input);
$input=str_replace("\r","",$input);
return $input;
}
--
http://www.php.net/manual/en/function.urlencode.php
http://master.php.net/manage/user-notes.php?action=edit+26579
http://master.php.net/manage/user-notes.php?action=delete+26579
http://master.php.net/manage/user-notes.php?action=reject+26579