You could store the accented characters in your DB if you set
everything to UTF-8, including calling the "SET NAMES utf8" MySQL
command after connecting. I find this much easier than
encoding/decoding.
Marc
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.
On Sat, Mar 14, 2009 at 12:18 AM, Lester Caine wrote:
> This probably one of the reasons some of us think that getting a stable PHP6
> based on unicode out of the door would probably be a lot more use to people
> than PHP5.3 ;)
+1
I cannot wait for full unicode. mbstring, iconv, all this wacky
Heddon's Gate Hotel wrote:
Thanks Jan, it's much clearer now. My knowledge about character
encodings has multiplied 100-fold in the last 24 hours' research.
Would it be a good idea for the PHP Manual to address some of these
issues, by explaining good practice in encoding arbitrary user input
Thanks Jan, it's much clearer now. My knowledge about character
encodings has multiplied 100-fold in the last 24 hours' research.
Would it be a good idea for the PHP Manual to address some of these
issues, by explaining good practice in encoding arbitrary user input in
forms (for example), fo
2009/3/13 Heddon's Gate Hotel :
> The string function htmlentities seems to have very incomplete coverage of
> the HTML entities listed in the HTML 4 spec. For example, it does not know
> about rsquo, lsquo, rdquo, ldquo, etc. This is confirmed by looking at the
> output of get_html_translation_t
> I came across a similar problem using an AJAX thing, with MSWord
> characters in the text. The way round the problem was to enclose
> everything inside CDATA blocks, which made the browsers happy to
> receive as the entities only had to be understood by the HTML browser
> now, not the XML pa
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, November 25, 2008 11:28 AM
> To: php-general@lists.php.net
> Subject: Re: [PHP] HTMLEntities as NUMERIC for XML
>
>
> > I came across a similar problem using
On Sun, January 27, 2008 12:27 pm, jekillen wrote:
> Hello:
> I have a form that has a textarea and I do not want to
> disallow the use of single quote as apostrophe, or
> for any other normal stylization. So I am using html
> entities to change these characters into html entities.
> But the functi
On Jan 27, 2008, at 10:37 AM, Nathan Nobbe wrote:
On Jan 27, 2008 1:27 PM, jekillen <[EMAIL PROTECTED]> wrote:
I have a form that has a textarea and I do not want to
disallow the use of single quote as apostrophe, or
for any other normal stylization. So I am using html
entities to change thes
On Sun, 2008-01-27 at 10:27 -0800, jekillen wrote:
> Hello:
> I have a form that has a textarea and I do not want to
> disallow the use of single quote as apostrophe, or
> for any other normal stylization. So I am using html
> entities to change these characters into html entities.
> But the funct
On Jan 27, 2008 1:27 PM, jekillen <[EMAIL PROTECTED]> wrote:
> Hello:
> I have a form that has a textarea and I do not want to
> disallow the use of single quote as apostrophe, or
> for any other normal stylization. So I am using html
> entities to change these characters into html entities.
> But
Ronald Wiplinger wrote:
I tried to understand htmlentities by putting this code into a test.php:
Test of evil input
";
$field2=htmlentities($field1,ENT_QUOTES,UTF-8);
echo "field2=$field2";
you are echo'ing the same field1 variable as before.
by your comments at the bottom of what you
It is doing that ;)
If you look at the source, you will see the expected output.
On Nov 17, 2007, at 4:41 AM, Ronald Wiplinger <[EMAIL PROTECTED]> wrote:
I tried to understand htmlentities by putting this code into a
test.php:
Test of evil input
";
$field2=htmlentities($field1,EN
Hi,
I tried to understand htmlentities by putting this code into a test.php:
[...]
The output on the screen is:
field1=*Greater input and lower input*
field2=Greater input and lower input
Greater input and lower input
A 'quote' is bold
A 'quote' is bold
I expected that it would give me in
On Wed, 26 Jul 2006 14:59:46 +0200, Jochem Maas wrote:
>
> I wonder if anyone can given a solid answer to this?
If I remember correctly, htmlspecialchars does what its name indicate:
konvert any character with special meaning according to the HTML
specification. htmlentities converts any characte
Dave Goodchild wrote:
> Hi all. I know htmlspecialchars converts the smallest set of entities
> possible to generate valid HTML, and that htmlentities goes much
> further, so
> what is the difference? Is it not better to use htmlentities in every case,
> making htmlspecialchars somewhat redundant,
On 5/4/06, Marten Lehmann <[EMAIL PROTECTED]> wrote:
Hello,
I want to use htmlentities() with UTF-8, which I can set with the third
parameter. But to use the third parameter, I have to provide the second
parameter. Currently the default for the second parameter is ENT_COMPAT.
But as this might c
Marten Lehmann wrote:
Hello,
I want to use htmlentities() with UTF-8, which I can set with the third
parameter. But to use the third parameter, I have to provide the second
parameter. Currently the default for the second parameter is ENT_COMPAT.
But as this might change, I don't want to call
On Thu, May 4, 2006 11:02 am, Marten Lehmann wrote:
> I want to use htmlentities() with UTF-8, which I can set with the
> third
> parameter. But to use the third parameter, I have to provide the
> second
> parameter. Currently the default for the second parameter is
> ENT_COMPAT.
> But as this migh
Chris Shiflett wrote:
> View source, and I think you'll understand. Or, remove the call to
> htmlentities().
>
> Chris
..
Thank you all for your assistance.
Best...
TR
...
"...when a browser sees <, it prints out a < character instead of
thinking "OK here comes an HTML tag.
> Copied and pasted the following sample script from the php manual and this
> outputs:
>
> ...
> $str = "A 'quote' is bold";
> echo htmlentities($str);
>
> ?>
> ..
>
> // outputs: A 'quote' is bold
>
> Not sure why the I am still getting the tags and spaces after the call to
>
> Copied and pasted the following sample script from the php manual and this
> outputs:
>
> ...
> $str = "A 'quote' is bold";
> echo htmlentities($str);
>
> ?>
> ..
>
> // outputs: A 'quote' is bold
>
> Not sure why the I am still getting the tags and spaces after the call to
>
--- Anthony Ritter <[EMAIL PROTECTED]> wrote:
> Copied and pasted the following sample script from the php manual
> and this outputs:
>
> ...
> $str = "A 'quote' is bold";
> echo htmlentities($str);
>
> ?>
> ..
>
> // outputs: A 'quote' is bold
>
> Not sure why the I am sti
On Monday, September 15, 2003, at 12:58 PM, John W. Holmes wrote:
Justin French wrote:
Hi all,
I need to convert some text from a database for presentation on
screen... as per usual, characters like quotes and ampersands (&) are
giving me grief. the obvious answer is to apply htmlspecialchars
On Monday, September 15, 2003, at 12:58 PM, John W. Holmes wrote:
Justin French wrote:
Hi all,
I need to convert some text from a database for presentation on
screen... as per usual, characters like quotes and ampersands (&) are
giving me grief. the obvious answer is to apply htmlspecialchars
Justin French wrote:
Hi all,
I need to convert some text from a database for presentation on
screen... as per usual, characters like quotes and ampersands (&) are
giving me grief. the obvious answer is to apply htmlspecialchars(), BUT
this also converts all < and > into < and > signs, which d
On Sat, Sep 13, 2003 at 11:24:56AM -0700, Michael Winston wrote:
:
: The request: Can the macintosh character set be added as an option for
: htmlentities() and other commands? That would be so helpful for our
: mac-based company.
:
: The problem: I'm fairly new to php and have found that th
On Saturday 28 September 2002 09:13 pm, John W. Holmes wrote:
> > -Original Message-
> > From: Andre Dubuc [mailto:[EMAIL PROTECTED]]
> > Sent: Saturday, September 28, 2002 9:14 PM
> > To: [EMAIL PROTECTED]; 'Sascha Cunz'; [EMAIL PROTECTED]
> > Subj
> -Original Message-
> From: Andre Dubuc [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, September 28, 2002 9:14 PM
> To: [EMAIL PROTECTED]; 'Sascha Cunz'; [EMAIL PROTECTED]
> Subject: Re: [PHP] Htmlentities and Newlines?
>
> On Saturday 28 September 2002
On Saturday 28 September 2002 08:59 pm, John W. Holmes wrote:
> > -Original Message-
> > From: Andre Dubuc [mailto:[EMAIL PROTECTED]]
> > Sent: Saturday, September 28, 2002 9:00 PM
> > To: [EMAIL PROTECTED]; 'Sascha Cunz'; [EMAIL PROTECTED]
> > Subj
> -Original Message-
> From: Andre Dubuc [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, September 28, 2002 9:00 PM
> To: [EMAIL PROTECTED]; 'Sascha Cunz'; [EMAIL PROTECTED]
> Subject: Re: [PHP] Htmlentities and Newlines?
>
> On Saturday 28 September 2002
> Does PHP do what? By default the MySQL query function can only take one
> query at a time. There is nothing strange about this. The command-line
> mysql tool can take multiple queries separated by semi-colons, but that is
> something that is implemented in that command-line tool. It is not d
On Saturday 28 September 2002 08:42 pm, John W. Holmes wrote:
> > Short question: following your advice, what would the data look like
>
> in
>
> > the
> > db if I typed in:
> >
> > Hi Sascha.
> > Next line is doubled.
> >
> > Double.
> >
> > How would that appear iun the db? In mine,
> Short question: following your advice, what would the data look like
in
> the
> db if I typed in:
>
> Hi Sascha.
> Next line is doubled.
>
> Double.
>
> How would that appear iun the db? In mine, it looks exactly like I
typed
> it
> above (using 1 & 2 with magic_quotes=on).
On Saturday 28 September 2002 08:32 pm, John W. Holmes wrote:
> > -Original Message-
> > From: Andre Dubuc [mailto:[EMAIL PROTECTED]]
> > Sent: Saturday, September 28, 2002 8:34 PM
> > To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> > Subject: Re: [PHP] Htmlent
> > Yeah, good catch on the addslash/magic_quote.
> >
> > Also, FYI: PHP will only allow you to do one query per mysql_query(). So
> > you can't try to end a quote and then send another query. Don't know if
> > this is the case for all database functions, or what...
>
> Does PHP this? Such behavio
> -Original Message-
> From: Andre Dubuc [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, September 28, 2002 8:34 PM
> To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: Re: [PHP] Htmlentities and Newlines?
>
> On Saturday 28 September 2002 07:55 pm, John W. Holm
> Yeah, good catch on the addslash/magic_quote.
>
> Also, FYI: PHP will only allow you to do one query per mysql_query(). So
> you can't try to end a quote and then send another query. Don't know if
> this is the case for all database functions, or what...
Does PHP this? Such behaviour would be p
On Saturday 28 September 2002 08:19 pm, Sascha Cunz wrote:
> > Hi John,
> >
> > Sorry about the ambiguity. What I'm trying to accomplish is close to what
> > you describe. However, before anything goes into the db (ie html chars,
> > bad commands, or anything from Mr.Hacker), I verify it. Someone
> /* db access using postgresql - each row is displayed */
> ...
> {$myrow['request']}
> ...
> ?>
>
> Now unless I can do something like:
>
> 'nl2br({$myrow['request']}'
Try something like
echo ''.nl2br($myrow['request'].'';
Regards Sascha
--
PHP General Mailing List (http://www.php.net/)
ginal Message-
> From: Sascha Cunz [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, September 28, 2002 8:19 PM
> To: [EMAIL PROTECTED]; [EMAIL PROTECTED]; php-
> [EMAIL PROTECTED]
> Subject: Re: [PHP] Htmlentities and Newlines?
>
> > Hi John,
> >
> > Sorry about the
On Saturday 28 September 2002 07:55 pm, John W. Holmes wrote:
> > Sorry about the ambiguity. What I'm trying to accomplish is close to
>
> what
>
> > you
> > describe. However, before anything goes into the db (ie html chars,
>
> bad
>
> > commands, or anything from Mr.Hacker), I verify it. Someon
> Hi John,
>
> Sorry about the ambiguity. What I'm trying to accomplish is close to what
> you describe. However, before anything goes into the db (ie html chars, bad
> commands, or anything from Mr.Hacker), I verify it. Someone suggested, way
> back when I first started with textarea, to use 'htm
> Sorry about the ambiguity. What I'm trying to accomplish is close to
what
> you
> describe. However, before anything goes into the db (ie html chars,
bad
> commands, or anything from Mr.Hacker), I verify it. Someone suggested,
way
> back when I first started with textarea, to use 'htmlentities'
t; > -Original Message-
> > From: Andre Dubuc [mailto:[EMAIL PROTECTED]]
> > Sent: Saturday, September 28, 2002 6:25 PM
> > To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> > Subject: Re: [PHP] Htmlentities and Newlines?
> >
> > On Saturday 28 September 2002 03:30
:[EMAIL PROTECTED]]
> Sent: Saturday, September 28, 2002 6:25 PM
> To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: Re: [PHP] Htmlentities and Newlines?
>
> On Saturday 28 September 2002 03:30 pm, John W. Holmes wrote:
> > > Perhaps I don't understand the use of
On Saturday 28 September 2002 03:30 pm, John W. Holmes wrote:
> > Perhaps I don't understand the use of 'htmlentities' too well, but I
>
> would
>
> > like newlines to be retained/inserted into a db, and then if
>
> displayed, to
>
> > produce a new line from a textarea. However, I want the possib
> Perhaps I don't understand the use of 'htmlentities' too well, but I
would
> like newlines to be retained/inserted into a db, and then if
displayed, to
> produce a new line from a textarea. However, I want the possibility of
> dangerous html excluded (hence the use of 'htmlentities').
>
> Is th
nl2br() covertes newlines to tags (something a browser will render).
Andre Dubuc wrote:
>Perhaps I don't understand the use of 'htmlentities' too well, but I would
>like newlines to be retained/inserted into a db, and then if displayed, to
>produce a new line from a textarea. However, I want
On Saturday 06 April 2002 18:34, Joerg Hanke [ML-php] wrote:
> hi!
>
> i've got the following problem and hope one of you is able to help me
> solving that:
>
> i've got a system in php that writes data (e.g. variable-name = $data)
> to a mysql database. there are two more scripts: one for display
50 matches
Mail list logo