Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #14041 > unrolled thread

Re: encoding

Started byDenis McMahon <denismfmcmahon@gmail.com>
First post2014-06-26 07:04 +0000
Last post2014-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.


Contents

  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

#14041 — Re: encoding

FromDenis McMahon <denismfmcmahon@gmail.com>
Date2014-06-26 07:04 +0000
SubjectRe: 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]


#14042

FromChristoph Michael Becker <cmbecker69@arcor.de>
Date2014-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');
  // => '&Atilde;&curren;'

  htmlentities("\xC3\xA4", ENT_COMPAT, 'UTF-8');
  // => '&auml;'

-- 
Christoph M. Becker

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.php


csiph-web