The Euro symbol, default charset and htmlentities()

From: Date: Tue, 22 Jan 2002 11:35:40 +0000
Subject: The Euro symbol, default charset and htmlentities()
Groups: php.general 
Request: Send a blank email to php-general+get-81526@lists.php.net to get a copy of this message
Hi everybody! I'm a bit lost. The original problem was (and still is) to get the Euro symbol from a iso-8859-15 string into the HTML code output by a PHP-script (4.0.6 by the way). At first it worked fine using htmlentities("€",ENT_QUOTES,"iso-8859-15"). However, this is a bit long, I would have plenty of htmlentities() to fix, and since -15 should be the considered the current standard rather than the outdated -1 it replaced, I wanted to figure out how to tell PHP and its htmlentities() which character set to use as default. First question: Where's the configuration for that? mbstring.* ini php.ini doesn't seem to be the right place (and I didn't expect it anyway). So, after learning that mbstring.* doesn't work I removed these from php.ini and now the extended htmlentities() doesn't work anymore. The line echo htmlentities("€",ENT_QUOTES,"iso-8859-15"); results in a "Wrong parameter count for htmlentities()"-warning. Oops? Second question: What's wrong now? I'm sure it worked earlier and I can't see that this line is wrong anyway. htmlentities() expects upto three arguments, there are three. And, not related to a problem, the third question: Did anybody yet consider setting iso-8859-15 as default charset throughout PHP instead of iso-8859-1? Regards, soenk.e

« previous php.general (#81526) next »