Ask a Question related to PHP Development, Design and Development.
-
David Nicholson #1
Re: [PHP] HTML equivalents of accented characters
Hello,
This is a reply to an e-mail that you wrote on Mon, 11 Aug 2003 at
19:18, lines prefixed by '>' were originally written by you.sure> I don't think this has been discussed, although I'm not reallyable> what you would call these accented characters, so I haven't beenbeen> to do a complete search of the archives, so apologies if this hasone> previously discussed.
> Is there a function that not only turns & into &, " into ",
> and the like, but also turns é into é and likewise with other
> accented characters? I know I could easily write one, but why ifecho htmlentities("é"); // outputs é> already exists?
See [url]http://php.net/htmlentities[/url]
David.
--
phpmachine :: The quick and easy to use service providing you with
professionally developed PHP scripts :: [url]http://www.phpmachine.com/[/url]
Free PHP error handling script: [url]www.phpmachine.com/error-handler/[/url]
Professional Web Development by David Nicholson
[url]http://www.djnicholson.com/[/url]
QuizSender.com - How well do your friends actually know you?
[url]http://www.quizsender.com/[/url]
David Nicholson Guest
-
Accented characters in PHP code messed up
Hi, I edit several PHP pages with Contrbute (since the first release) for my Web site. I found a problem lately. If I got accented characters in... -
HTML Editor for Chinese Characters?? Help!
Is there a free/cheap HTML editor out there that a colleague of mine in China can use to view Chinese characters while editing an HTML page? I can... -
CFFILE and extended ASCII/accented characters
Hello- I'm using CF 6.1 as a front-end to a MySQL database that happens to contain extended ASCII characters (e.g., accented vowels). CF displays... -
MX and Panther: can't type accented characters
SOS. I can't get a reply from Macromedia on this one: Under Panther OSX 10.3 in Director MX, you can't type in accented characters (such as... -
Scandinavic characters in external html
I have a external HTML file and i load it into a dynamic textfield with LoadVars. Theres no problem loading the external text, but when there is... -
Didier McGillis #2
Re: [PHP] HTML equivalents of accented characters
[url]http://hotwired.lycos.com/webmonkey/reference/special_characters/[/url]
should have all you want
__________________________________________________ _______________>From: "Liam Gibbs" <liamgibbs@sympatico.ca>
>To: "php list" <php-general@lists.php.net>
>Subject: [PHP] HTML equivalents of accented characters
>Date: Mon, 11 Aug 2003 14:18:37 -0400
>
>I don't think this has been discussed, although I'm not really sure what
>you would call these accented characters, so I haven't been able to do a
>complete search of the archives, so apologies if this has been previously
>discussed.
>
>Is there a function that not only turns & into &, " into ", and
>the like, but also turns é into é and likewise with other accented
>characters? I know I could easily write one, but why if one already exists?
Protect your PC - get McAfee.com VirusScan Online
http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963
Didier McGillis Guest
-
Liam Gibbs #3
Re: [PHP] HTML equivalents of accented characters
> I think php.net/htmlentities will do this.
Apparently it *is*, but it won't for me. Any problems with this code?
$result[] = "é";
$result[1] = htmlspecialchars($result[0]);
$result[2] = htmlentities($result[0]);
Both return the accented E unchanged.
Liam Gibbs Guest
-
Liam Gibbs #4
Re: [PHP] HTML equivalents of accented characters
> I bet they do, did you check the HTML source as well? My guess is that the
as> source is reading the actual expected output, but your browser views "é",Sorry, should have mentioned. The source code reads the actual character,> it should of course.
not the é.
Liam Gibbs Guest
-
Ivo Fokkema #5
Re: [PHP] HTML equivalents of accented characters
"Liam Gibbs" <liamgibbs@sympatico.ca> wrote in message
news:002b01c36194$dec89fd0$4d59fea9@TeletranOne...the> > I bet they do, did you check the HTML source as well? My guess is that"é",> > source is reading the actual expected output, but your browser viewsHmmm... interesting... I tested your exact code in this format :> as> Sorry, should have mentioned. The source code reads the actual character,> > it should of course.
> not the é.
<?php
$result[] = "é";
$result[1] = htmlspecialchars($result[0]);
$result[2] = htmlentities($result[0]);
foreach ($result as $val) {
print ("[" . $val . "]");
}
?>
which returned (sourcecode)
[é][é][é]
So with me, htmlentities works. Did you try this :
$a = get_html_translation_table(HTML_ENTITIES);
var_dump($a);
? With me, it returns a 99 elements array with loads of characters,
including the "é". (PHP/4.2.3 on Win2000)
I have no idea what might be the problem, what does your translation table
look like?
--
Ivo Fokkema
Ivo Fokkema Guest
-
Liam Gibbs #6
Re: [PHP] HTML equivalents of accented characters
> I have no idea what might be the problem, what does your translation table
Mine is still coming out as a single character. Here's my code, in case> look like?
anyone can spot any stupid human error blunder I'm making:
$translationtable = get_html_translation_table(HTML_ENTITIES);
$string = htmlspecialchars($string);
Also, here's my setup, just in case:
PHP 4.3.1
Linux 2.2.19 #1 i586
Apache 1.3.27
MySQL 3.23.49 (don't know what this has to do with it, but just in case
there has been some interference with PHP and MySQL)
GD 2.0 compatible
Liam Gibbs Guest



Reply With Quote

