Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.php > #14041 > unrolled thread
| Started by | Denis McMahon <denismfmcmahon@gmail.com> |
|---|---|
| First post | 2014-06-26 07:04 +0000 |
| Last post | 2014-06-26 13:20 +0200 |
| Articles | 2 — 2 participants |
Back to article view | Back to comp.lang.php
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: encoding Denis McMahon <denismfmcmahon@gmail.com> - 2014-06-26 07:04 +0000
Re: encoding Christoph Michael Becker <cmbecker69@arcor.de> - 2014-06-26 13:20 +0200
| From | Denis McMahon <denismfmcmahon@gmail.com> |
|---|---|
| Date | 2014-06-26 07:04 +0000 |
| Subject | Re: encoding |
| Message-ID | <loggl4$sdo$7@dont-email.me> |
On Thu, 26 Jun 2014 05:50:06 +0000, Denis McMahon wrote: > I'm not sure how to fix this. Ideas anyone? Fix was: htmlentities( $string, ENT_COMPAT, "UTF-8" ); Not sure if I actually need the setlocale or not. Seems to work without it. ENT_HTML5 isn't supported in my server distro's current php (5.3) ... mutter mutter -- Denis McMahon, denismfmcmahon@gmail.com
[toc] | [next] | [standalone]
| From | Christoph Michael Becker <cmbecker69@arcor.de> |
|---|---|
| Date | 2014-06-26 13:20 +0200 |
| Message-ID | <53ac01f4$0$6604$9b4e6d93@newsspool4.arcor-online.net> |
| In reply to | #14041 |
Denis McMahon wrote:
> htmlentities( $string, ENT_COMPAT, "UTF-8" );
>
> Not sure if I actually need the setlocale or not. Seems to work without
> it.
In PHP < 5.4 the default of the 3rd parameter is 'ISO-8859-1', so
setting this parameter appropriately is important when $string may
contain non ASCII characters. For instance:
htmlentities("\xC3\xA4", ENT_COMPAT, 'ISO-8859-1');
// => 'ä'
htmlentities("\xC3\xA4", ENT_COMPAT, 'UTF-8');
// => 'ä'
--
Christoph M. Becker
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.php
csiph-web